Solved by albanD in post #2 
              
              
                Hi, 
Yes all of the factory functions like randn or ones are independent of the nn.Module device. 
So in general, you want to provide a device= argument to these functions if you want the Tensor to be created on a special device. 
You can get the right device from any param or input of your Module. 
…