def annotate_true_sparse_output(tensor: tf.SparseTensor):
  """Annotates a true sparse output to avoid representing it as varlen."""
  tf.compat.v1.add_to_collection(
      _ANNOTATED_TRUELY_SPARSE_TENSORS, tensor.values
  )
Annotates a true sparse output to avoid representing it as varlen.
tensorflow_transform/schema_inference.py