libtorch
torch::Tensor idx=torch::zeros({270,360});
torch::Tensor t=torch::zeros({255});
//idx里的值作为t的索引
torch::Tensor out=t.index({idx})
python
out=t[idx]
1.python
t[i,j]
2.libtorch
t.index({i,j})
原文:https://www.cnblogs.com/ggs403/p/15213289.html