A Tensor has requires_grad=True if gradients for it need to computed during the backward pass. This can be either because this Tensor needs gradients in the case where it’s a leaf Tensor or because some Tensor that were used to compute this one requires gradients and so gradients need to be computed to be passed to the previous layer.