Skip to content

Commit

Permalink
Patch 3 (#2389)
Browse files Browse the repository at this point in the history
* Updates #836 as suggested in pytorch/pytorch#16885 (comment)
  • Loading branch information
TheMemoryDealer authored Jun 1, 2023
1 parent e1ec4bd commit d078756
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion beginner_source/former_torchies/parallelism_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ def forward(self, x):

class MyDataParallel(nn.DataParallel):
def __getattr__(self, name):
return getattr(self.module, name)
try:
return super().__getattr__(name)
except AttributeError:
return getattr(self.module, name)

########################################################################
# **Primitives on which DataParallel is implemented upon:**
Expand Down

0 comments on commit d078756

Please sign in to comment.