eI = I[..., None, None].expand(-1, -1, 1, X.size(3)) # make eI the same for the last dimension Y = torch.gather(X, dim=2, index=eI).squeeze().
確定! 回上一頁