I experienced the same issue and hence filed a report here:

  
      github.com/pytorch/pytorch
  
  
    



Issue: Deepcopy doesn't copy to same gpu 43


	
	opened by crazyoscarchang
	on 2018-12-02
	
	
	


This issue was first reported here: https://discuss.pytorch.org/t/deepcopy-with-multiple-gpus/20283
from copy import deepcopy
import torch
x = torch.ones((1,), device=torch.device("cuda", 1))
print(x)
## result : tensor([ 1.], device='cuda:1') 
y...




  
  
    
    
  
  


Another problem with deepcopy (https://github.com/pytorch/pytorch/issues/315 27) was just recently fixed, but not yet available on the most recent stable version of pytorch, i.e. 0.4.1.