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
c6a928ca
"docs/source/vscode:/vscode.git/clone" did not exist on "ba552dd0274206628d59ea349171a0d4d8632c3a"
Unverified
Commit
c6a928ca
authored
Oct 11, 2022
by
Partho
Committed by
GitHub
Oct 10, 2022
Browse files
wrap forward passes with torch.no_grad() (#19414)
parent
d739a707
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
tests/models/imagegpt/test_modeling_imagegpt.py
tests/models/imagegpt/test_modeling_imagegpt.py
+2
-1
No files found.
tests/models/imagegpt/test_modeling_imagegpt.py
View file @
c6a928ca
...
@@ -538,6 +538,7 @@ class ImageGPTModelIntegrationTest(unittest.TestCase):
...
@@ -538,6 +538,7 @@ class ImageGPTModelIntegrationTest(unittest.TestCase):
inputs
=
feature_extractor
(
images
=
image
,
return_tensors
=
"pt"
).
to
(
torch_device
)
inputs
=
feature_extractor
(
images
=
image
,
return_tensors
=
"pt"
).
to
(
torch_device
)
# forward pass
# forward pass
with
torch
.
no_grad
():
outputs
=
model
(
**
inputs
)
outputs
=
model
(
**
inputs
)
# verify the logits
# verify the logits
...
...
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