Args: ds (DataFlow): the input DataFlow. infinite (bool): When set to False, will raise StopIteration when ds is exhausted.
(self, ds, infinite=True)
| 90 | self._itr = self._ds.__iter__() |
| 91 | |
| 92 | def __init__(self, ds, infinite=True): |
| 93 | """ |
| 94 | Args: |
| 95 | ds (DataFlow): the input DataFlow. |
| 96 | infinite (bool): When set to False, will raise StopIteration when |
| 97 | ds is exhausted. |
| 98 | """ |
| 99 | if not isinstance(ds, DataFlow): |
| 100 | raise ValueError("FeedInput takes a DataFlow! Got {}".format(ds)) |
| 101 | self.ds = ds |
| 102 | if infinite: |
| 103 | self._iter_ds = RepeatedData(self.ds, -1) |
| 104 | else: |
| 105 | self._iter_ds = self.ds |
| 106 | |
| 107 | def _size(self): |
| 108 | return len(self.ds) |
nothing calls this directly
no test coverage detected