We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eee76b3 commit 181f2f6Copy full SHA for 181f2f6
torchdata/datapipes/iter/util/converter.py
@@ -5,8 +5,7 @@
5
# LICENSE file in the root directory of this source tree.
6
7
import warnings
8
-
9
-from typing import Callable, Dict, Optional
+from typing import Callable, Dict, Iterator, Optional
10
11
from torch.utils.data import IterDataPipe, MapDataPipe
12
from torch.utils.data.datapipes.utils.common import _check_unpickable_fn, DILL_AVAILABLE
@@ -59,6 +58,8 @@ class IterToMapConverterMapDataPipe(MapDataPipe):
59
58
key_value_fn: Optional[Callable]
60
_map: Optional[Dict]
61
_length: int
+ _itr: Optional[Iterator]
62
+ _depleted: bool
63
64
def __init__(self, datapipe: IterDataPipe, key_value_fn: Optional[Callable] = None):
65
if not isinstance(datapipe, IterDataPipe):
0 commit comments