Hi,
I think this can help:
list_of_tensors = [torch.randn(1, 2, 2), torch.randn(1, 2, 2), torch.randn(1, 2, 2)]
b = torch.Tensor(len(list_of_tensors), 2, 2)
b = torch.cat(list_of_tensors, dim=0)
print(b.shape)
b = b.cuda()
print(b.device)

Please see this thread:

  
    
    
    How to turn a list of tensor to tensor? 
  
  
    I have a list and there are many tensor in the list 
I want to turn it to just tensor, and I can put it to dataloader 
I use for loop and cat the tensor but it is very slow, data size is about 4,800,000
  


Bests