Hi,
In this post I have written a code to transfer a list of CPU tensors to GPU which all have the same shape (in your case all have shape of (1, )).

  
    
    
    Input a list of tensors to a model without the need to manually transfer each item to cuda 
  
  
    Hi, 
I’d like to input a list of tensors to my model. However, pytorch doesn’t automatically transfer each item in this list to cuda and I need to manually do that each time by .cuda() . Is there a better more elegant way of dealing with this?
  


Bests