Skip to content

Commit ad47d6d

Browse files
committed
fixed type annotations for compatibility
1 parent c82219a commit ad47d6d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

torchvision/datasets/places365.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,10 @@ def process(line: str) -> Tuple[str, int]:
127127

128128
return sorted(class_to_idx.keys()), class_to_idx
129129

130-
def load_file_list(self, download: bool = True) -> Tuple[List[Tuple[str, int | None]], List[int | None]]:
131-
def process(line: str, sep="/") -> Tuple[str, int | None]:
130+
def load_file_list(
131+
self, download: bool = True
132+
) -> Tuple[List[Tuple[str, Union[int, None]]], List[Union[int, None]]]:
133+
def process(line: str, sep="/") -> Tuple[str, Union[int, None]]:
132134
image, idx = (line.split() + [None])[:2]
133135
image = cast(str, image)
134136
idx = int(idx) if idx is not None else None

0 commit comments

Comments
 (0)