Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap ImageGPT integration test forward passes with torch.no_grad() #19414

Merged
merged 1 commit into from Oct 10, 2022
Merged

Wrap ImageGPT integration test forward passes with torch.no_grad() #19414

merged 1 commit into from Oct 10, 2022

Conversation

daspartho
Copy link
Contributor

What does this PR do?

As proposed in issue #14642, this PR wraps forward passes in ImageGPT integration tests with torch.no_grad(). This way, no unnecessary gradients are computed during inference.

Before submitting

  • This PR fixes a typo or improves the docs.
  • Did you read the contributor guideline, Pull Request section?
  • Was this discussed/approved via a Github issue or the forum?
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

Who can review?

@LysandreJik could you please take a look at it?
Thanks :)

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Oct 7, 2022

The documentation is not available anymore as the PR was closed or merged.

Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you @daspartho!

@LysandreJik LysandreJik merged commit c6a928c into huggingface:main Oct 10, 2022
@daspartho daspartho deleted the add-no-grad-imagegpt-integration-test branch October 10, 2022 19:28
ajsanjoaquin pushed a commit to ajsanjoaquin/transformers that referenced this pull request Oct 12, 2022
amyeroberts pushed a commit to amyeroberts/transformers that referenced this pull request Oct 18, 2022
kashif pushed a commit to kashif/transformers that referenced this pull request Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants