Bootstrap

Pytorch笔记:诡异的索引操作 + too many indices for tensor of dimension 1的一种解决方法

问题

too many indices for tensor of dimension 1

具体的错误信息忘记截图,大概就是上面的意思,对应的错误代码如下

错误代码

# 下面代码是博主自己随意码的,具体要说一下怎么解决这种问题
import torch
index = torch.tensor([20,10,25,39,5,
;