Solved by Nikronic in post #4 
              
              
                Hi, 
@CedricLy 's suggestion is the correct way of doing it. 
Note that torch.tensor(another_tensor) works like tensor.clone().detach() which causes the trouble you have mentioned. 
Also, you are printing a1.grad which gives you a tensor instead of None because it should not be a leaf tensor but bec…