torch.Tensor.retain_grad¶
- 
Tensor.retain_grad() → None¶ Enables this Tensor to have their
gradpopulated duringbackward(). This is a no-op for leaf tensors.
Tensor.retain_grad() → None¶Enables this Tensor to have their grad populated during
backward(). This is a no-op for leaf tensors.