def _flatten_value_to_list(
    batch_values: Tuple[np.ndarray, ...]) -> Iterable[Any]:
  """Converts an N-D dense or sparse batch to a 1-D list."""
  batch_value, = batch_values

  # TODO(b/36603294): Perhaps obviate the tolist(). It is currently used so
  # that we go to native Python types for more efficient followup
  # processing.
  return batch_value.tolist()
Converts an N-D dense or sparse batch to a 1-D list.
tensorflow_transform/beam/analyzer_impls.py