Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
df1ec6b1
Unverified
Commit
df1ec6b1
authored
Jun 09, 2022
by
Stas Bekman
Committed by
GitHub
Jun 09, 2022
Browse files
didn't exist in pt-1.9 (#17644)
parent
fba0b6a8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
src/transformers/utils/import_utils.py
src/transformers/utils/import_utils.py
+4
-1
No files found.
src/transformers/utils/import_utils.py
View file @
df1ec6b1
...
...
@@ -305,7 +305,10 @@ def is_torch_bf16_available():
is_torch_gpu_bf16_available
=
False
# 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
return
is_torch_cpu_bf16_available
or
is_torch_gpu_bf16_available
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment