Class initializer. Args: reader: The underlying reader object doing the actual read. num_iter: Number of batches to read. If `None`, the class reverts to a normal reader except that it also produces a data_finished blob as a side effec
(self, reader, num_iter=1)
| 415 | the data steam. |
| 416 | """ |
| 417 | def __init__(self, reader, num_iter=1): |
| 418 | """Class initializer. |
| 419 | |
| 420 | Args: |
| 421 | reader: The underlying reader object doing the actual read. |
| 422 | num_iter: Number of batches to read. If `None`, |
| 423 | the class reverts to a normal reader except that it also |
| 424 | produces a data_finished blob as a side effect to indicate |
| 425 | whether the input stream is exhausted. |
| 426 | """ |
| 427 | super().__init__(reader) |
| 428 | self.counter = None |
| 429 | self.num_iter = num_iter |
| 430 | if self.num_iter is not None: |
| 431 | self.counter = self.net.AddExternalInput( |
| 432 | self.net.NextName('counter')) |
| 433 | |
| 434 | def setup_limiter(self, global_init_net, global_finish_net): |
| 435 | if self.counter: |
nothing calls this directly
no test coverage detected