Indexing a 2D tensor - PyTorch Forums
https://discuss.pytorch.org/t/indexing-a-2d-tensor/166705.04.2017 · What is the major difference between gather and index_select, other than that gather “gathers” values and index_select “selects” values? Is there any difference on the basis of underlying storage? Also, if I want to assign a sub-tensor of a tensor (indexed using index_select) to a new value? How do I do that? For example, t = torch.Tensor([[1,2,5],[3,4,6]]) t1 = …
How to select index over two dimension? - PyTorch Forums
https://discuss.pytorch.org/t/how-to-select-index-over-two-dimension/1009818.11.2017 · Given a = torch.randn(3, 2, 4, 5), how I can select sub tensor like (2, :, 0, :), (1, :, 1, :), (2, :, 2, :), (0, :, 3, :) (a resulting tensor of size (2, 4, 5) or (4 ...