"configs/git@developer.sourcefind.cn:wangsen/paddle_dbnet.git" did not exist on "30e8f905cd1b32e19f7cc77e11136389fbbb7ea1"
Unverified Commit df1ec6b1 authored by Stas Bekman's avatar Stas Bekman Committed by GitHub
Browse files

didn't exist in pt-1.9 (#17644)

parent fba0b6a8
...@@ -305,7 +305,10 @@ def is_torch_bf16_available(): ...@@ -305,7 +305,10 @@ def is_torch_bf16_available():
is_torch_gpu_bf16_available = False is_torch_gpu_bf16_available = False
# checking CPU # checking CPU
if not hasattr(torch.cpu.amp, "autocast"): try:
# multiple levels of AttributeError depending on the pytorch version so do them all in one check
_ = torch.cpu.amp.autocast
except AttributeError:
is_torch_cpu_bf16_available = False is_torch_cpu_bf16_available = False
return is_torch_cpu_bf16_available or is_torch_gpu_bf16_available return is_torch_cpu_bf16_available or is_torch_gpu_bf16_available
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment