Skip to content

Commit 9a04ceb

Browse files
Update parallelism_tutorial.py
added nn.DataParallel
1 parent 4b6497c commit 9a04ceb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: beginner_source/former_torchies/parallelism_tutorial.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def forward(self, x):
5151
# clashes in their names. For those who still want to access the attributes,
5252
# a workaround is to use a subclass of ``DataParallel`` as below.
5353

54-
class MyDataParallel(DataParallel):
54+
class MyDataParallel(nn.DataParallel):
5555
def __getattr__(self, name):
5656
try:
5757
return super().__getattr__(name)

0 commit comments

Comments
 (0)