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