class_docstr: Wrapper around operators for reading from text files.
docstr: Create op for building a TextFileReader instance in the workspace.
  
  Args:
      init_net   : Net that will be run only once at startup.
      filename   : Path to file to read from.
      schema     : schema.Struct representing the schema of the data.
                   Currently, only support Struct of strings and float32.
      num_passes : Number of passes over the data.
      batch_size : Number of rows to read at a time.
docstr_tok: ["Create","op","for","building","a","TextFileReader","instance","in","the","workspace",".","Args",":","init_net",":","Net","that","will","be","run","only","once","at","startup",".","filename",":","Path","to","file","to","read","from",".","schema",":","schema.Struct","representing","the","schema","of","the","data",".","Currently",",","only","support","Struct","of","strings","and","float32",".","num_passes",":","Number","of","passes","over","the","data",".","batch_size",":","Number","of","rows","to","read","at","a","time","."]
code: def __init__(
      self, init_net, filename, schema, num_passes=1, batch_size=1
  ):
      """
      Create op for building a TextFileReader instance in the workspace.
  
      Args:
          init_net   : Net that will be run only once at startup.
          filename   : Path to file to read from.
          schema     : schema.Struct representing the schema of the data.
                       Currently, only support Struct of strings and float32.
          num_passes : Number of passes over the data.
          batch_size : Number of rows to read at a time.
      """
      assert isinstance(
          schema, Struct
      ), "Schema must be a schema.Struct"
      for name, child in schema.get_children():
          assert isinstance(
              child, Scalar
          ), "Only scalar fields are supported in TextFileReader."
      field_types = [
          data_type_for_dtype(dtype) for dtype in schema.field_types()
      ]
      Reader.__init__(self, schema)
      self._reader = init_net.CreateTextFileReader(
          [],
          filename=filename,
          num_passes=num_passes,
          field_types=field_types,
      )
      self._batch_size = batch_size
  
imports: from caffe2.python import core
  from caffe2.python.dataio import Reader
  from caffe2.python.schema import Scalar, Struct, data_type_for_dtype
label_desc: Use image node_id 1 to create a new TextFileReader object from inherited base classes: Reader with example: obj = TextFileReader(init_net, filename, schema, num_passes, batch_size)