docstr: From the Dataset, create a _DatasetReader and setup a init_net.
  
  Make sure the _init_field_blobs_as_empty(...) is only called once.
  
  Because the underlying NewRecord(...) creats blobs by calling
  NextScopedBlob(...), so that references to previously-initiated
  empty blobs will be lost, causing accessibility issue.
docstr_tok: ["From","the","Dataset",",","create","a","_DatasetReader","and","setup","a","init_net",".","Make","sure","the","_init_field_blobs_as_empty","(","...",")","is","only","called","once",".","Because","the","underlying","NewRecord","(","...",")","creats","blobs","by","calling","NextScopedBlob","(","...",")",",","so","that","references","to","previously-initiated","empty","blobs","will","be","lost",",","causing","accessibility","issue","."]
code: def setup_ex(self, init_net, finish_net):
      """From the Dataset, create a _DatasetReader and setup a init_net.
  
      Make sure the _init_field_blobs_as_empty(...) is only called once.
  
      Because the underlying NewRecord(...) creats blobs by calling
      NextScopedBlob(...), so that references to previously-initiated
      empty blobs will be lost, causing accessibility issue.
      """
      if self.ds_reader:
          self.ds_reader.setup_ex(init_net, finish_net)
      else:
          self._init_field_blobs_as_empty(init_net)
          self._feed_field_blobs_from_db_file(init_net)
          self.ds_reader = self.ds.random_reader(
              init_net,
              batch_size=self.batch_size,
              loop_over=self.loop_over,
          )
          self.ds_reader.sort_and_shuffle(init_net)
          self.ds_reader.computeoffset(init_net)
  
file_path: pytorch/caffe2/python/db_file_reader.py
imports: from caffe2.python import core, scope, workspace, _import_c_extension
  from caffe2.python.dataio import Reader
  from caffe2.python.dataset import Dataset
  from caffe2.python.schema import from_column_list
  import os
label_desc: Use image node_id 4 for calling the DBFileReader obj's underlying member method code with example usage: obj.setup_ex(init_net, finish_net) without return types