def _to_string(x: common_types.TensorType) -> common_types.TensorType:
  """Converts values in the given `Tensor` or `CompositeTensor` to strings."""
  if x.dtype is tf.string:
    return x
  return _map_values(tf.strings.as_string, x)
Converts values in the given `Tensor` or `CompositeTensor` to strings.
tensorflow_transform/tf_utils.py