torch.Tensor.requires_grad¶ Tensor.requires_grad¶ 如果此 Tensor 需要計算梯度,則為 True,否則為 False。 注意 對於 Tensor 需要計算梯度的事實並不意味著其 grad 屬性會被填充,更多詳細資訊請參閱 is_leaf。