I have this code:
import torch
list_of_tensors = [ torch.randn(3), torch.randn(3), torch.randn(3)]
tensor_of_tensors = torch.tensor(list_of_tensors)
I am getting the error:
ValueError: only one element tensors can be converted to Python scalars
How can I convert the list of tensors to a tensor of tensors in pytorch?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…