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

Method read

caffe2/python/text_file_reader.py:42–58  ·  view source on GitHub ↗

Create op for reading a batch of rows.

(self, net)

Source from the content-addressed store, hash-verified

40 self._batch_size = batch_size
41
42 def read(self, net):
43 """
44 Create op for reading a batch of rows.
45 """
46 blobs = net.TextFileReaderRead(
47 [self._reader],
48 len(self.schema().field_names()),
49 batch_size=self._batch_size)
50 if type(blobs) is core.BlobReference:
51 blobs = [blobs]
52
53 is_empty = net.IsEmpty(
54 [blobs[0]],
55 core.ScopedBlobReference(net.NextName('should_stop'))
56 )
57
58 return (is_empty, blobs)

Callers

nothing calls this directly

Calls 3

NextNameMethod · 0.80
field_namesMethod · 0.45
schemaMethod · 0.45

Tested by

no test coverage detected