torch_npu.npu.conv.allow_hf32
产品支持情况
| 产品 | 是否支持 |
|---|---|
| Atlas A3 训练系列产品 | √ |
| Atlas A2 训练系列产品 | √ |
| Atlas 推理系列产品 | √ |
| Atlas 训练系列产品 | √ |
功能说明
conv类算子开启支持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 = bool
参数说明
输入bool值,默认值True。
输出说明
bool
调用示例
>>>import torch
>>>import torch_npu
>>>torch_npu.npu.conv.allow_hf32
True
>>>torch_npu.npu.conv.allow_hf32=False
>>>torch_npu.npu.conv.allow_hf32
False
>>>torch_npu.npu.conv.allow_hf32=True
>>>torch_npu.npu.conv.allow_hf32
True