快捷方式

torch.clone

torch.clone(input, *, memory_format=torch.preserve_format) Tensor

返回 input 的副本。

注意

此函式是可微分的,因此梯度將從該操作的結果流回 input。要建立一個與 input 沒有 autograd 關係的 Tensor,請參閱 detach()

引數

input (Tensor) – 輸入 Tensor。

關鍵字引數

memory_format (torch.memory_format, 可選) – 返回 Tensor 所需的記憶體格式。預設值:torch.preserve_format

文件

查閱 PyTorch 的全面開發者文件

檢視文件

教程

獲取針對初學者和高階開發者的深度教程

檢視教程

資源

查詢開發資源並獲得問題解答

檢視資源