Hi Aryan!



 r112:

What would be the best way to remove every other column of this tensor:


Use tensor indexing:
>>> import torch
>>> torch.__version__
'1.9.0'
>>> t = torch.tensor([[ 1, 2, 3, 4, 5],
... [ 6, 7, 8, 9, 10],
... [11, 12, 13, 14, 15]])
>>> t[:, [0, 2, 4]]
tensor([[ 1,  3,  5],
        [ 6,  8, 10],
        [11, 13, 15]])

Best.
K. Frank