Closed
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.
Please update https://pytorch.org/tutorials/beginner/transformer_tutorial.html and other tutorials to avoid the use. Recommended way for snapshotting is to use torch.save() for trained models. to create multiple clones of an untrained model, create multiple copies from first principles from the model architectural parameters.
cc @pytorch/team-text-core @Nayef211