ptrblck:

for this


I understand that, but wouldn’t that require a reshape or modification of scores to work obtain indices for both the 2D and 3D tensors, rather than a solution that works for both?
One not-entirely-elegant solution I did was
idx_stacked= torch.stack([idx] * bbox.share[-1], dim=idx.dim()
bbox = torch.gather(bbox, dim=1, index=idx_stacked)

Unsure if there a cleaner way to do it.