Gradient Issue after using torch.no_grad

with torch.no_grad():

It seems that tensors originating from the block with this with statement may continue to be affected by no_grad. In addition, there appear to be cases where the effect remains due to caching…
https://stackoverflow.com/questions/63785319/pytorch-torch-no-grad-versus-requires-grad-false

1 Like