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):
66
66
67
67
# convert to an iterator and look at one random sample
68
68
dataiter = iter (train_loader )
69
- data = dataiter . next ()
69
+ data = next (dataiter )
70
70
features , labels = data
71
71
print (features , labels )
72
72
@@ -97,6 +97,6 @@ def __len__(self):
97
97
98
98
# look at one random sample
99
99
dataiter = iter (train_loader )
100
- data = dataiter . next ()
100
+ data = next (dataiter )
101
101
inputs , targets = data
102
102
print (inputs .shape , targets .shape )
Original file line number Diff line number Diff line change 35
35
shuffle = False )
36
36
37
37
examples = iter (test_loader )
38
- example_data , example_targets = examples . next ()
38
+ example_data , example_targets = next (examples )
39
39
40
40
for i in range (6 ):
41
41
plt .subplot (2 ,3 ,i + 1 )
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ def imshow(img):
45
45
46
46
# get some random training images
47
47
dataiter = iter (train_loader )
48
- images , labels = dataiter . next ()
48
+ images , labels = next (dataiter )
49
49
50
50
# show images
51
51
imshow (torchvision .utils .make_grid (images ))
Original file line number Diff line number Diff line change 43
43
shuffle = False )
44
44
45
45
examples = iter (test_loader )
46
- example_data , example_targets = examples . next ()
46
+ example_data , example_targets = next (examples )
47
47
48
48
for i in range (6 ):
49
49
plt .subplot (2 ,3 ,i + 1 )
You can’t perform that action at this time.
0 commit comments