torch.Tensor.retain_grad¶ Tensor.retain_grad() → None¶ 使此 Tensor 能夠在 backward() 期間填充其 grad 屬性。對於葉子 Tensor,此操作無效。