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
b37cf7de
"vscode:/vscode.git/clone" did not exist on "9fecdbaf276c9399bcc3574eb2dd2107e3ab9599"
Unverified
Commit
b37cf7de
authored
Dec 20, 2021
by
Henrik Holm
Committed by
GitHub
Dec 20, 2021
Browse files
Add 'with torch.no_grad()' to integration test forward pass (#14821)
parent
952a77b0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
tests/test_modeling_deberta.py
tests/test_modeling_deberta.py
+2
-1
No files found.
tests/test_modeling_deberta.py
View file @
b37cf7de
...
@@ -275,6 +275,7 @@ class DebertaModelIntegrationTest(unittest.TestCase):
...
@@ -275,6 +275,7 @@ class DebertaModelIntegrationTest(unittest.TestCase):
input_ids
=
torch
.
tensor
([[
0
,
31414
,
232
,
328
,
740
,
1140
,
12695
,
69
,
46078
,
1588
,
2
]])
input_ids
=
torch
.
tensor
([[
0
,
31414
,
232
,
328
,
740
,
1140
,
12695
,
69
,
46078
,
1588
,
2
]])
attention_mask
=
torch
.
tensor
([[
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
]])
attention_mask
=
torch
.
tensor
([[
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
]])
with
torch
.
no_grad
():
output
=
model
(
input_ids
,
attention_mask
=
attention_mask
)[
0
]
output
=
model
(
input_ids
,
attention_mask
=
attention_mask
)[
0
]
# compare the actual values for a slice.
# compare the actual values for a slice.
expected_slice
=
torch
.
tensor
(
expected_slice
=
torch
.
tensor
(
...
...
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