MCPcopy Create free account
hub / github.com/NVIDIA/DALI / IteratorWrapper

Class IteratorWrapper

dali/test/python/test_fw_iterators.py:1231–1239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1229 # This wrapper is used to test that the base class iterator doesn't invoke
1230 # the wrapper self.__next__ function accidentally
1231 class IteratorWrapper(BaseIterator):
1232 def __init__(self, *args, **kwargs):
1233 self._allow_next = False
1234 super(IteratorWrapper, self).__init__(*args, **kwargs)
1235
1236 # Asserting if __next__ is called, unless self._allow_next has been set to True explicitly
1237 def __next__(self):
1238 assert self._allow_next
1239 _ = super(IteratorWrapper, self).__next__()
1240
1241 pipe = Pipeline(batch_size=16, num_threads=1, device_id=0)
1242 with pipe:

Calls

no outgoing calls

Tested by 1