Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion grain/_src/python/dataset/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1708,6 +1708,12 @@ def __init__(self, parent: IterDataset[T], options: base.DatasetOptions):
self.options = options

def __iter__(self) -> DatasetIterator[T]:
"""Returns an iterator for the dataset.

Propagates the options through the pipeline ensuring there's a single merged
options object. Depending on the options, may apply iterator
transformations.
"""
result = self._parent.__iter__()
# The parent iterator options are merged from the entire subtree. Merge
# them with the latest options and update the subtree options.
Expand Down Expand Up @@ -1737,7 +1743,7 @@ class _OutputIterDataset(IterDataset[T]):
"""Dataset that is injected at the end of every pipeline."""

def __iter__(self) -> DatasetIterator[T]:
"""Performs any injection that needs to happen at the end of the pipeline."""
"""Performs injections that need to happen at the end of the pipeline."""

# Loaded lazily due to a circular dependency (dataset <-> prefetch).
# pylint: disable=g-import-not-at-top
Expand Down
Loading