我想通过索引数组或张量删除张量列。例如:
th> X = torch.rand(2,4)
th> X
0.7475 0.2512 0.6085 0.6414
0.7143 0.8299 0.2929 0.6945
[torch.DoubleTensor of size 2x4]
th> indices = torch.zeros(2)
th> indices[1] = 1
th> indices[2] = 3
th> indices
1
3
[torch.DoubleTensor of size 2]
th> X:delete(indices)
0.2512 0.6414
0.8299 0.6945