torch.Tensor.half¶
- Tensor.half(memory_format=torch.preserve_format) Tensor ¶
self.half()
等同于self.to(torch.float16)
。参见to()
。- 参数
memory_format (
torch.memory_format
, optional) – 返回 Tensor 的期望内存格式。默认值:torch.preserve_format
。
self.half()
等同于 self.to(torch.float16)
。参见 to()
。
memory_format (torch.memory_format
, optional) – 返回 Tensor 的期望内存格式。默认值:torch.preserve_format
。