torch.Tensor.float¶
- Tensor.float(memory_format=torch.preserve_format) Tensor ¶
self.float()
等价于self.to(torch.float32)
。 请参阅to()
。- 参数
memory_format (
torch.memory_format
, 可选) – 返回 Tensor 的所需内存格式。默认值:torch.preserve_format
。
self.float()
等价于 self.to(torch.float32)
。 请参阅 to()
。
memory_format (torch.memory_format
, 可选) – 返回 Tensor 的所需内存格式。默认值: torch.preserve_format
。