def _get_tensor_ranges_v2(metadata):
  """Lookup overrides for `Tensor`s  or `SparseTensor`s."""
  tensors = metadata[_TF_METADATA_TENSOR_COLLECTION]
  min_values = metadata[_TF_METADATA_TENSOR_MIN_COLLECTION]
  max_values = metadata[_TF_METADATA_TENSOR_MAX_COLLECTION]
  assert len(tensors) == len(min_values), '{} != {}'.format(tensors, min_values)
  assert len(tensors) == len(max_values), '{} != {}'.format(tensors, max_values)
  return {
      tensor.numpy().decode(): (min_value.numpy(), max_value.numpy())
      for (tensor, min_value, max_value) in zip(tensors, min_values, max_values)
  }
Lookup overrides for `Tensor`s  or `SparseTensor`s.
tensorflow_transform/schema_inference.py