parameters: (self)
docstring: Yield a dict with key to be fields in schema, and value to be data.
          This function is for old version tensorflow whose version number < 2.1.0
  
          Yields:
              dict, data dictionary whose keys are the same as columns.
docstring_summary: Yield a dict with key to be fields in schema, and value to be data.
          This function is for old version tensorflow whose version number < 2.1.0
docstring_tokens: Yield a dict with key to be fields in schema and value to be data . This function is for old version tensorflow whose version number < 2 . 1 . 0
function: def tfrecord_iterator_oldversion(self):
          """
          Yield a dict with key to be fields in schema, and value to be data.
          This function is for old version tensorflow whose version number < 2.1.0
  
          Yields:
              dict, data dictionary whose keys are the same as columns.
          """
          dataset = self.tf.data.TFRecordDataset(self.source)
          dataset = dataset.map(self._parse_record)
          iterator = dataset.make_one_shot_iterator()
          with self.tf.Session() as sess:
              while True:
                  try:
                      ms_dict = {}
                      sample = iterator.get_next()
                      sample = sess.run(sample)
                      for key, val in sample.items():
                          cast_key = _cast_name(key)
                          if cast_key in self.scalar_set:
                              self._get_data_when_scalar_field_oldversion(ms_dict, cast_key, key, val)
                          else:
                              if not isinstance(val, np.ndarray) and not isinstance(val, list):
                                  raise ValueError("The response key: {}, value: {} from "
                                                   "TFRecord should be a ndarray or "
                                                   "list.".format(key, val))
                              # list set
                              ms_dict[cast_key] = \
                                  np.asarray(val, _cast_string_type_to_np_type(self.mindrecord_schema[cast_key]["type"]))
                      yield ms_dict
                  except self.tf.errors.OutOfRangeError:
                      break
                  except self.tf.errors.InvalidArgumentError:
                      raise ValueError("TFRecord feature_dict parameter error.")
function_tokens: def tfrecord_iterator_oldversion ( self ) : dataset = self . tf . data . TFRecordDataset ( self . source ) dataset = dataset . map ( self . _parse_record ) iterator = dataset . make_one_shot_iterator ( ) with self . tf . Session ( ) as sess : while True : try : ms_dict = { } sample = iterator . get_next ( ) sample = sess . run ( sample ) for key , val in sample . items ( ) : cast_key = _cast_name ( key ) if cast_key in self . scalar_set : self . _get_data_when_scalar_field_oldversion ( ms_dict , cast_key , key , val ) else : if not isinstance ( val , np . ndarray ) and not isinstance ( val , list ) : raise ValueError ( "The response key: {}, value: {} from " "TFRecord should be a ndarray or " "list." . format ( key , val ) ) # list set ms_dict [ cast_key ] = np . asarray ( val , _cast_string_type_to_np_type ( self . mindrecord_schema [ cast_key ] [ "type" ] ) ) yield ms_dict except self . tf . errors . OutOfRangeError : break except self . tf . errors . InvalidArgumentError : raise ValueError ( "TFRecord feature_dict parameter error." )