torch.Tensor.detach_¶ Tensor.detach_()¶ 將 Tensor 從建立它的計算圖中分離,使其成為葉節點。檢視 (View) 無法就地分離。 此方法也會影響前向模式 AD 梯度,結果將永遠不會具有前向模式 AD 梯度。