假设我有如下三维tensor:
matrix = torch.tensor([ [ [1,2,3], [4,5,6] ], [ [2,3,4], [5,6,7] ] ])
索引方法为:
matrix[ [ [0], [1] ], [ [0,1], [1,1] ], [ [2,1], [1,2] ] ]
其索引过程为: