我有这个代码:
import torch list_of_tensors = [ torch.randn(3), torch.randn(3), torch.randn(3)] tensor_of_tensors = torch.tensor(list_of_tensors)
我收到错误:
ValueError:只有一个元素张量可以转换为Python标量
如何将张量列表转换为pytorch中的张量张量?
python python-3.x pytorch
python ×1
python-3.x ×1
pytorch ×1