Skip to content

Commit 5196845

Browse files
committed
Fixing typing issue.
1 parent e952e09 commit 5196845

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

torchvision/datasets/stl10.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,4 +182,6 @@ def __load_folds(self, folds: Optional[int]) -> None:
182182
with open(path_to_folds, 'r') as f:
183183
str_idx = f.read().splitlines()[folds]
184184
list_idx = np.fromstring(str_idx, dtype=np.uint8, sep=' ')
185-
self.data, self.labels = self.data[list_idx, :, :, :], self.labels[list_idx]
185+
self.data = self.data[list_idx, :, :, :]
186+
if self.labels is not None:
187+
self.labels = self.labels[list_idx]

0 commit comments

Comments
 (0)