Solved by albanD in post #2 
              
              
                It requires same type in the sense of float/double/long right? You can use type_as() on v_tensor before giving it to copy. You should enclose this into a with torch.no_grad(): block to avoid errors because you modified inplace a leaf tensor.