torch.Tensor.requires_grad¶ Tensor.requires_grad¶ 如果需要为此张量计算梯度,则为True,否则为False。 注意 计算张量的梯度并不意味着 grad 属性会被填充,更多详情请参见 is_leaf。