We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 54ed13c commit 8ad842cCopy full SHA for 8ad842c
torch/utils/data/datapipes/dataframe/structures.py
@@ -1,4 +1,5 @@
1
-# mypy: allow-untyped-defs
+from typing import Any, Iterator
2
+
3
from torch.utils.data.datapipes.dataframe import dataframe_wrapper as df_wrapper
4
from torch.utils.data.datapipes.datapipe import DataChunk
5
@@ -9,11 +10,11 @@
9
10
class DataChunkDF(DataChunk):
11
"""DataChunkDF iterating over individual items inside of DataFrame containers, to access DataFrames user `raw_iterator`."""
12
- def __iter__(self):
13
+ def __iter__(self) -> Iterator[Any]:
14
for df in self.items:
15
yield from df_wrapper.iterate(df)
16
- def __len__(self):
17
+ def __len__(self) -> int:
18
total_len = 0
19
20
total_len += df_wrapper.get_len(df)
0 commit comments