Solved by tom in post #2 
              
              
                This should have gotten you 
UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor).

Of course, you actually want to do something entirely differen, namely yo…