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
f134d385
Unverified
Commit
f134d385
authored
Oct 04, 2022
by
Partho
Committed by
GitHub
Oct 04, 2022
Browse files
wrap forward passes with torch.no_grad() (#19279)
parent
cd024da6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
tests/models/deit/test_modeling_deit.py
tests/models/deit/test_modeling_deit.py
+2
-1
No files found.
tests/models/deit/test_modeling_deit.py
View file @
f134d385
...
...
@@ -384,7 +384,8 @@ class DeiTModelIntegrationTest(unittest.TestCase):
inputs
=
feature_extractor
(
images
=
image
,
return_tensors
=
"pt"
).
to
(
torch_device
)
# forward pass
outputs
=
model
(
**
inputs
)
with
torch
.
no_grad
():
outputs
=
model
(
**
inputs
)
# verify the logits
expected_shape
=
torch
.
Size
((
1
,
1000
))
...
...
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