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
7f65daa2
Unverified
Commit
7f65daa2
authored
Aug 04, 2020
by
Patrick von Platen
Committed by
GitHub
Aug 04, 2020
Browse files
fix reformer fp16 (#6237)
parent
7ea9b2db
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
tests/test_modeling_reformer.py
tests/test_modeling_reformer.py
+1
-1
No files found.
tests/test_modeling_reformer.py
View file @
7f65daa2
...
@@ -389,7 +389,7 @@ class ReformerModelTester:
...
@@ -389,7 +389,7 @@ class ReformerModelTester:
model
.
to
(
torch_device
)
model
.
to
(
torch_device
)
model
.
half
()
model
.
half
()
model
.
eval
()
model
.
eval
()
output
=
model
(
input_ids
,
attention_mask
=
input_mask
)[
"last_
input
_state"
]
output
=
model
(
input_ids
,
attention_mask
=
input_mask
)[
"last_
hidden
_state"
]
self
.
parent
.
assertFalse
(
torch
.
isnan
(
output
).
any
().
item
())
self
.
parent
.
assertFalse
(
torch
.
isnan
(
output
).
any
().
item
())
def
create_and_check_reformer_model_generate
(
self
,
config
,
input_ids
,
input_mask
,
choice_labels
):
def
create_and_check_reformer_model_generate
(
self
,
config
,
input_ids
,
input_mask
,
choice_labels
):
...
...
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