File tree Expand file tree Collapse file tree 4 files changed +5
-5
lines changed
Expand file tree Collapse file tree 4 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ def __len__(self):
6666
6767# convert to an iterator and look at one random sample
6868dataiter = iter (train_loader )
69- data = dataiter . next ()
69+ data = next (dataiter )
7070features , labels = data
7171print (features , labels )
7272
@@ -97,6 +97,6 @@ def __len__(self):
9797
9898# look at one random sample
9999dataiter = iter (train_loader )
100- data = dataiter . next ()
100+ data = next (dataiter )
101101inputs , targets = data
102102print (inputs .shape , targets .shape )
Original file line number Diff line number Diff line change 3535 shuffle = False )
3636
3737examples = iter (test_loader )
38- example_data , example_targets = examples . next ()
38+ example_data , example_targets = next (examples )
3939
4040for i in range (6 ):
4141 plt .subplot (2 ,3 ,i + 1 )
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ def imshow(img):
4545
4646# get some random training images
4747dataiter = iter (train_loader )
48- images , labels = dataiter . next ()
48+ images , labels = next (dataiter )
4949
5050# show images
5151imshow (torchvision .utils .make_grid (images ))
Original file line number Diff line number Diff line change 4343 shuffle = False )
4444
4545examples = iter (test_loader )
46- example_data , example_targets = examples . next ()
46+ example_data , example_targets = next (examples )
4747
4848for i in range (6 ):
4949 plt .subplot (2 ,3 ,i + 1 )
You can’t perform that action at this time.
0 commit comments