Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
d533c7e9
Unverified
Commit
d533c7e9
authored
Jul 15, 2020
by
Funtowicz Morgan
Committed by
GitHub
Jul 15, 2020
Browse files
[fix] T5 ONNX test: model.to(torch_device) (#5769)
Signed-off-by:
Morgan Funtowicz
<
morgan@huggingface.co
>
parent
d0486c8b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
tests/test_modeling_t5.py
tests/test_modeling_t5.py
+1
-1
No files found.
tests/test_modeling_t5.py
View file @
d533c7e9
...
@@ -336,7 +336,7 @@ class T5ModelTest(ModelTesterMixin, unittest.TestCase):
...
@@ -336,7 +336,7 @@ class T5ModelTest(ModelTesterMixin, unittest.TestCase):
config_and_inputs
=
self
.
model_tester
.
prepare_config_and_inputs
()
config_and_inputs
=
self
.
model_tester
.
prepare_config_and_inputs
()
config_and_inputs
[
0
].
return_tuple
=
True
config_and_inputs
[
0
].
return_tuple
=
True
model
=
T5Model
(
config_and_inputs
[
0
])
model
=
T5Model
(
config_and_inputs
[
0
])
.
to
(
torch_device
)
with
tempfile
.
TemporaryDirectory
()
as
tmpdirname
:
with
tempfile
.
TemporaryDirectory
()
as
tmpdirname
:
torch
.
onnx
.
export
(
torch
.
onnx
.
export
(
model
,
config_and_inputs
[
1
],
f
"
{
tmpdirname
}
/t5_test.onnx"
,
export_params
=
True
,
opset_version
=
9
,
model
,
config_and_inputs
[
1
],
f
"
{
tmpdirname
}
/t5_test.onnx"
,
export_params
=
True
,
opset_version
=
9
,
...
...
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