TypeError: only integer tensors of a single element can be converted to an index
1.ValueError: only one element tensors can be converted to Python scalars2.TypeError: only integer tensors of a single element can be converted to an index这个两个报错很有意思,是一对亲兄弟,都发生在列表转化为tensor的过程中。
复制链接