MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / __init__

Method __init__

tensorpack/input_source/input_source.py:92–105  ·  view source on GitHub ↗

Args: ds (DataFlow): the input DataFlow. infinite (bool): When set to False, will raise StopIteration when ds is exhausted.

(self, ds, infinite=True)

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 2

RepeatedDataClass · 0.85
formatMethod · 0.80

Tested by

no test coverage detected