Hi! I want to know if there exits a better way with torch.gather or something of doing the following:

I have x,y tensors with the indices of the correspondent samples of the batch, which represent the x-y coordinates of the respective samples i. So, if the batchsize = 8, they are a tensor like of 8 components respectively, whose values are between W and H respectively

x = voxel_indices [:, 0, u, v].long(), y = voxel_coordinates [:, 1, u, v].long()

Then, I want to use this indices in order to index a feature map (Bs, Ch, W, H) like this

features_map[:, :, x, y]

However, this gives me a tensor of [8, 256, 8], while I only want a tensor of [8, 256], with one feature map per each sample of the batch.