Rate this Page

torch.Tensor.requires_grad#

Tensor.requires_grad#

IsTrue if gradients need to be computed for this Tensor,False otherwise.

Note

The fact that gradients need to be computed for a Tensor do not mean that thegradattribute will be populated, seeis_leaf for more details.