我有这个代码:
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 中的张量张量?
互换的青春
慕村225694
相关分类