def _get_data_from_tfrecords()

in tfx_addons/feature_selection/component.py [0:0]


def _get_data_from_tfrecords(train_uri):
  # get all the data files
  train_uri = [
      os.path.join(train_uri, file_path)
      for file_path in _get_file_list(train_uri)
  ]
  raw_dataset = tf.data.TFRecordDataset(train_uri, compression_type='GZIP')

  np_dataset = []
  for tfrecord in raw_dataset:
    serialized_example = tfrecord.numpy()
    example = example_coder.ExampleToNumpyDict(serialized_example)
    np_dataset.append(example)

  return np_dataset