You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
__iter__ in pl_bolts/datamodules/experience_source.py is annotated as returning an Iterable when it should return an Iterator (__iter__ is implemented on Iterables to give Iterators).
To Reproduce
With lightning bolts master and Python 3.9 and PyTorch master:
python3 setup.py bdist_wheel
Traceback (most recent call last):
File "/home/tv/pytorch/lightning/lightning-bolts/setup.py", line 13, in <module>
from pl_bolts import __about__ as about
File "/home/tv/pytorch/lightning/lightning-bolts/pl_bolts/__init__.py", line 11, in <module>
from pl_bolts import ( # noqa: E402
File "/home/tv/pytorch/lightning/lightning-bolts/pl_bolts/datamodules/__init__.py", line 5, in <module>
from pl_bolts.datamodules.experience_source import DiscountedExperienceSource, ExperienceSource, ExperienceSourceDataset
File "/home/tv/pytorch/lightning/lightning-bolts/pl_bolts/datamodules/experience_source.py", line 24, in <module>
class ExperienceSourceDataset(IterableDataset):
File "/usr/local/lib/python3.9/dist-packages/torch/utils/data/_typing.py", line 256, in __new__
return super().__new__(cls, name, bases, namespace)
File "/usr/lib/python3.9/abc.py", line 85, in __new__
cls = super().__new__(mcls, name, bases, namespace, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/torch/utils/data/_typing.py", line 330, in _dp_init_subclass
raise TypeError("Expected 'Iterator' as the return annotation for `__iter__` of {}"
Expected behavior
Working setup.py
Environment
PyTorch 1.9 (master)
OS (e.g., Linux): Linux
How you installed PyTorch (conda, pip, source): self-built + pip
Additional context
I didn't check more type annotations.
The text was updated successfully, but these errors were encountered:
🐛 Bug
__iter__
inpl_bolts/datamodules/experience_source.py
is annotated as returning anIterable
when it should return anIterator
(__iter__
is implemented onIterable
s to giveIterator
s).To Reproduce
With lightning bolts master and Python 3.9 and PyTorch master:
Expected behavior
Working setup.py
Environment
conda
,pip
, source): self-built + pipAdditional context
I didn't check more type annotations.
The text was updated successfully, but these errors were encountered: