Rate this Page

torch.Tensor.grad#

Tensor.grad#

This attribute isNone by default and becomes a Tensor the first time a call tobackward() computes gradients forself.The attribute will then contain the gradients computed and future calls tobackward() will accumulate (add) gradients into it.