For example, I have a tensor a of shape [k, m, n] and tensor b fo shape [k, ]. What I want to do is to get a[torch.arange(k), b]. Is there any api provided by PyTorch can directly deal with it? Creating a new tensor using torch.arange(k) doesn’t look that elegant.