torch_npu.npu.conv.allow_hf32
torch_npu.npu.conv.allow_hf32功能和调用方式与torch.backends.cudnn.allow_tf32类似,torch.backends.cudnn.allow_tf32的功能具体请参考https://pytorch.org/docs/stable/backends.html#torch.backends.cudnn.allow_tf32。
torch_npu.npu.conv.allow_hf32的调用方式如下所示:
API接口
torch_npu.npu.conv.allow_hf32 = bool
功能描述
conv类算子开启支持hf32类型能力。
参数说明
输入bool值,默认值True。
输出说明
bool类型。
示例
def test_conv_allow_hf32(self): res = torch.npu.conv.allow_hf32 self.assertEqual(res, True) torch.npu.conv.allow_hf32 = True res = torch.npu.conv.allow_hf32 self.assertEqual(res, True) torch.npu.conv.allow_hf32 = False res = torch.npu.conv.allow_hf32 self.assertEqual(res, False)
父主题: torch_npu.npu