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。