Hi,
If you want to change the value of a tensor that requires gradients without it being tracked by the autograd engine, you should do:
with torch.no_grad():
    a.copy_(b)

As is done for weight initialization 41 for example in the nn.init package.
If thinks don’t require gradients and have no grad_fn associated with it, you can simply do:
a.copy_(b)