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

Method __init__

caffe2/python/dataio.py:417–432  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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:

Callers

nothing calls this directly

Calls 3

AddExternalInputMethod · 0.80
NextNameMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected