torch.Tensor.half

Tensor.half(memory_format=torch.preserve_format)Tensor

self.half() 等同于 self.to(torch.float16)。详情参见 to()

参数

memory_format (torch.memory_format, 可选) – 指定返回的张量的内存格式。默认值为:torch.preserve_format

本页目录