torch.Tensor.cpu¶
- Tensor.cpu(memory_format=torch.preserve_format) Tensor ¶
傳回此物件在 CPU 記憶體中的副本。
如果此物件已位於 CPU 記憶體中,且在正確的裝置上,則不會執行複製,並傳回原始物件。
- 參數
memory_format (
torch.memory_format
, optional) – 傳回的 Tensor 所需的記憶體格式。預設值:torch.preserve_format
。
傳回此物件在 CPU 記憶體中的副本。
如果此物件已位於 CPU 記憶體中,且在正確的裝置上,則不會執行複製,並傳回原始物件。
memory_format (torch.memory_format
, optional) – 傳回的 Tensor 所需的記憶體格式。預設值:torch.preserve_format
。