torch.Tensor.cpu¶
- Tensor.cpu(memory_format=torch.preserve_format) Tensor ¶
返回此对象在 CPU 内存中的副本。
如果此对象已在 CPU 内存中,则不执行复制并返回原对象。
- 参数
memory_format (
torch.memory_format
, 可选) – 返回 Tensor 期望的内存格式。 默认值:torch.preserve_format
。
返回此对象在 CPU 内存中的副本。
如果此对象已在 CPU 内存中,则不执行复制并返回原对象。
memory_format (torch.memory_format
, 可选) – 返回 Tensor 期望的内存格式。 默认值:torch.preserve_format
。