I have been struggling with a way to select patches in images. Currently I am using a for loop as a patch may vary from image to image in the batch. The patch location is decided by the model.
In short I would like to index separate locations in images in a batch. The batch is a 4d matrix. (128,3,128,128)
My output should be (128,3,x,y).
Thanks richard. I wasn’t clear in my original post, what I wanted to do was apply the manipulation on the gpu. The issue was resolved by preparing a minibatch between calls.