def from_tfrecords(input_pattern):
  """Loads a dataset from TFRecord format to a list of dictionaries."""
  filenames = tf.io.gfile.glob(input_pattern)
  dataset = tf.data.TFRecordDataset(filenames=filenames)
  dataset = dataset.map(_parse_fn)
  dataset = list(map(postprocess_example, tfds.as_numpy(dataset)))
  return dataset
Loads a dataset from TFRecord format to a list of dictionaries.
language/fruit/tf_utils.py