class_docstr: TFRecord data which loads and processes TFRecord files.
  
  This module can be used to process image data, features, etc.
  
  Args:
      hparams (dict): Hyperparameters. See :meth:`default_hparams`
          for the defaults.
  
  The module reads and restores data from TFRecord files and
  results in a TF Dataset whose element is a Python `dict` that maps feature
  names to feature values. The features names and dtypes are specified in
  :attr:`hparams["dataset"]["feature_original_types"]`.
  
  The module also provides simple processing options for image data, such
  as image resize.
  
  Example:
  
      .. code-block:: python
  
          # Read data from TFRecord file
          hparams={
              'dataset': {
                  'files': 'image1.tfrecord',
                  'feature_original_types': {
                      'height': ['tf.int64', 'FixedLenFeature'],
                      'width': ['tf.int64', 'FixedLenFeature'],
                      'label': ['tf.int64', 'FixedLenFeature'],
                      'image_raw': ['tf.string', 'FixedLenFeature']
                  }
              },
              'batch_size': 1
          }
          data = TFRecordData(hparams)
          iterator = DataIterator(data)
          batch = iterator.get_next()
  
          iterator.switch_to_dataset(sess) # initializes the dataset
          batch_ = sess.run(batch)
          # batch_ == {
          #    'data': {
          #        'height': [239],
          #        'width': [149],
          #        'label': [1],
          #
          #        # 'image_raw' is a list of image data bytes in this
          #        # example.
          #        'image_raw': [...],
          #    }
          # }
  
      .. code-block:: python
  
          # Read image data from TFRecord file and do resizing
          hparams={
              'dataset': {
                  'files': 'image2.tfrecord',
                  'feature_original_types': {
                      'label': ['tf.int64', 'FixedLenFeature'],
                      'image_raw': ['tf.string', 'FixedLenFeature']
                  },
                  'image_options': {
                      'image_feature_name': 'image_raw',
                      'resize_height': 512,
                      'resize_width': 512,
                  }
              },
              'batch_size': 1
          }
          data = TFRecordData(hparams)
          iterator = DataIterator(data)
          batch = iterator.get_next()
  
          iterator.switch_to_dataset(sess) # initializes the dataset
          batch_ = sess.run(batch)
          # batch_ == {
          #    'data': {
          #        'label': [1],
          #
          #        # "image_raw" is a list of a "numpy.ndarray" image
          #        # in this example. Each image has a width of 512 and
          #        # height of 512.
          #        'image_raw': [...]
          #    }
          # }
code: def _process_dataset(self, dataset, hparams, data_spec):
      chained_tran, data_spec = self._make_processor(
          hparams["dataset"],
          data_spec,
          name_prefix=hparams["dataset"]["data_name"],
      )
      num_parallel_calls = hparams["num_parallel_calls"]
      dataset = dataset.map(
          lambda *args: chained_tran(dsutils.maybe_tuple(args)),
          num_parallel_calls=num_parallel_calls,
      )
  
      # Truncates data count
      dataset = dataset.take(hparams["max_dataset_size"])
  
      return dataset, data_spec
  
file_path: texar/texar/tf/data/data/tfrecord_data.py
imports: import tensorflow
  from texar.tf.data.data import dataset_utils
  from texar.tf.data.data.data_base import DataBase
  from texar.tf.data.data.mono_text_data import MonoTextData
  from texar.tf.data.data_decoders import TFRecordDataDecoder
label_desc: Use image node_id 5 for calling the TFRecordData obj's underlying member method code with example usage: obj._process_dataset(dataset, hparams, data_spec) and returns: dataset,  data_spec