0
我想通過數組或索引張量刪除張量列。例如:火炬:通過索引刪除張量列
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