Skip to content

Replace usage of copy.deepcopy() in favor of torch.save() to store best model params in transformer tutorial #2181

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

Merged
merged 3 commits into from
Jan 25, 2023

Conversation

Nayef211
Copy link
Contributor

@Nayef211 Nayef211 commented Jan 25, 2023

Description

copy.deepcopy is not defined for nn.module() and does not reliably copy an nn.module hierrchy, such as a model or partial model. Our tutorials should using copy.deepcopy() as this will induce our users to make incorrect use of the primitive.

See #2177 for further details

This addresses the issue for https://pytorch.org/tutorials/beginner/transformer_tutorial.html

cc @pytorch/team-text-core

@Nayef211 Nayef211 requested a review from mikekgfb January 25, 2023 00:21
@netlify
Copy link

netlify bot commented Jan 25, 2023

Deploy Preview for pytorch-tutorials-preview ready!

Name Link
🔨 Latest commit 18e5bfe
🔍 Latest deploy log https://app.netlify.com/sites/pytorch-tutorials-preview/deploys/63d166701ef66200083481e3
😎 Deploy Preview https://deploy-preview-2181--pytorch-tutorials-preview.netlify.app/beginner/transformer_tutorial
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@svekars svekars merged commit b47fdca into pytorch:main Jan 25, 2023
@Nayef211 Nayef211 deleted the hotfix/text_deepcopy branch January 25, 2023 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants