解决:
将注释的代码改为如下就不报错了,原因不清楚,有懂的大佬求指点
# torch.index_select(x1, 0, idx, out=xx1)
xx1 = torch.index_select(x1, 0, idx)
# torch.index_select(y1, 0, idx, out=yy1)
yy1 = torch.index_select(y1, 0, idx)
# torch.index_select(x2, 0, idx, out=xx2)
xx2 =<

在使用PyTorch时遇到错误:Index_select()函数不支持自动差异化。通过修改代码已解决此问题,但具体原因尚不清楚,寻求专家解答。
最低0.47元/天 解锁文章
2969





