Skip to content

Commit a7935ea

Browse files
truskovskiykfmassa
authored andcommitted
cast mnist targer to int (#605)
1 parent e15e81f commit a7935ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchvision/datasets/mnist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def __getitem__(self, index):
6767
Returns:
6868
tuple: (image, target) where target is index of the target class.
6969
"""
70-
img, target = self.data[index], self.targets[index]
70+
img, target = self.data[index], int(self.targets[index])
7171

7272
# doing this so that it is consistent with all other datasets
7373
# to return a PIL Image

0 commit comments

Comments
 (0)