Hi,
I have two same-size tensors that are binary masks: A, B
I want to relocate the mask that I have in B, in the region(randomly select any location and use it as an anchor) where A’s mask is located, but I don’t know how to implement it in pytorch.
e.g.
A:
[0 0 0 0 0 0 ]
[0 0 1 1 0 0 ]
[0 0 1 1 0 0 ]
[0 0 0 0 0 0 ]
B:
[0 0 0 0 0 0 ]
[0 0 0 0 0 0 ]
[0 0 0 0 1 0 ]
[0 0 0 0 0 1 ]
C=f(A,B):
[0 0 0 0 0 0 ]
[0 0 1 0 0 0 ]
[0 0 0 1 0 0 ]
[0 0 0 0 0 0 ]
or
[0 0 0 0 0 0 ]
[0 0 0 1 0 0 ]
[0 0 0 0 1 0 ]
[0 0 0 0 0 0 ]