def get_tfrecord_length(dataloader):
  """Return the length of a dataloader."""
  train_dataset_single = dataloader.get_batch(batch_size=1,
                                              shuffle=False,
                                              repeats=1)
  c = 0
  for _ in train_dataset_single:
    c += 1
  return c