Relative Content

Tag Archive for pytorchtensor

batched PyTorch tensor indexing

I have a source tensor of size (3, 2) and an index tensor of size (3, 3) containing integer values 0, 1, or 2. In pytorch I can do tensor indexing source[index] to get a tensor of size (3, 3, 2). Example: