torch.Tensor.retains_grad#
- Tensor.retains_grad#
 Is
Trueif this Tensor is non-leaf and itsgradis enabled to be populated duringbackward(),Falseotherwise.
Is True if this Tensor is non-leaf and its grad is enabled to be
populated during backward(), False otherwise.