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

Method reader

caffe2/python/dataset.py:276–300  ·  view source on GitHub ↗

Create a Reader object that is used to iterate through the dataset. This will append operations to `init_net` that create a TreeCursor, used to iterate through the data. NOTE: Currently, it is not safe to append to a dataset while reading. Args: init_ne

(self, init_net=None, cursor_name=None, batch_size=1,
               enforce_batch_size=False)

Source from the content-addressed store, hash-verified

274 return self.field_types
275
276 def reader(self, init_net=None, cursor_name=None, batch_size=1,
277 enforce_batch_size=False):
278 """Create a Reader object that is used to iterate through the dataset.
279
280 This will append operations to `init_net` that create a TreeCursor,
281 used to iterate through the data.
282
283 NOTE: Currently, it is not safe to append to a dataset while reading.
284
285 Args:
286 init_net: net that will be run once to create the cursor.
287 cursor_name: optional name for the blob containing a pointer
288 to the cursor.
289 batch_size: how many samples to read per iteration.
290
291 Returns:
292 A _DatasetReader that can be used to create operators that will
293 iterate through the dataset.
294 """
295 assert self.field_blobs, 'Dataset not initialized.'
296 reader = _DatasetReader(self, cursor_name, batch_size,
297 enforce_batch_size)
298 if init_net is not None:
299 reader.setup_ex(init_net, None)
300 return reader
301
302 def random_reader(self, init_net=None, indices=None, cursor_name=None,
303 batch_size=1, loop_over=False, enforce_batch_size=False):

Callers 5

build_pipelineFunction · 0.95
test_dequeue_manyMethod · 0.95
test_local_sessionMethod · 0.95
test_dataset_opsMethod · 0.95
test_record_queueMethod · 0.95

Calls 2

_DatasetReaderClass · 0.85
setup_exMethod · 0.45

Tested by 5

build_pipelineFunction · 0.76
test_dequeue_manyMethod · 0.76
test_local_sessionMethod · 0.76
test_dataset_opsMethod · 0.76
test_record_queueMethod · 0.76