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

Fix example in accumulate method documentation #1211

Merged
merged 1 commit into from Mar 19, 2023

Conversation

VikParuchuri
Copy link
Contributor

The accumulate method has an example of how to do gradient accumulation that has the context manager and the for loop in the wrong order. The _do_sync method is called only when the context manager is entered, so it needs to go inside the loop.

(I was wondering why my model wasn't converging well!)

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Mar 19, 2023

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

@muellerzr
Copy link
Collaborator

Thanks for catching this!

@muellerzr muellerzr merged commit 82c2665 into huggingface:main Mar 19, 2023
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