mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
remove allow-untyped-defs from torch/utils/data/datapipes/iter/filelister.py (#154624)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/154624 Approved by: https://github.com/Skylion007
This commit is contained in:
parent
639f459cb6
commit
dc82e911e7
|
|
@ -1,4 +1,3 @@
|
|||
# mypy: allow-untyped-defs
|
||||
from collections.abc import Iterator, Sequence
|
||||
from typing import Union
|
||||
|
||||
|
|
@ -63,7 +62,7 @@ class FileListerIterDataPipe(IterDataPipe[str]):
|
|||
path, self.masks, self.recursive, self.abspath, self.non_deterministic
|
||||
)
|
||||
|
||||
def __len__(self):
|
||||
def __len__(self) -> int:
|
||||
if self.length == -1:
|
||||
raise TypeError(f"{type(self).__name__} instance doesn't have valid length")
|
||||
return self.length
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user