code: def unique_consecutive(
      x: Union[tf.Tensor, tf.Variable],
      /,
      *,
      axis: Optional[int] = None,
  ) -> Tuple[
      Union[tf.Tensor, tf.Variable],
      Union[tf.Tensor, tf.Variable],
      Union[tf.Tensor, tf.Variable],
  ]:
      Results = namedtuple(
          "Results",
          ["output", "inverse_indices", "counts"],
      )
      x_shape = None
      if axis is None:
          x_shape = x.shape
          x = tf.reshape(x, -1)
          axis = -1
      ndim = len(x.shape)
      if axis < 0:
          axis += ndim
      splits = (
          tf.where(
              tf.math.reduce_any(
                  tf.experimental.numpy.diff(x, axis=axis) != 0,
                  axis=tuple(i for i in tf.range(ndim) if i != axis),
              )
          )
          + 1
      )
      if tf.size(splits) > 0:
          sub_arrays = tf.experimental.numpy.split(
              x, tf.reshape(splits, -1), axis=axis
          )
      else:
          sub_arrays = [x]
      output = tf.concat(
          [
              tf.raw_ops.UniqueV2(
                  x=sub_array, axis=tf.constant([axis])
              )[0]
              for sub_array in sub_arrays
          ],
          axis=axis,
      )
      counts = tf.convert_to_tensor(
          [sub_array.shape[axis] for sub_array in sub_arrays]
      )
      inverse_indices = tf.repeat(tf.range(len(counts)), counts)
      if x_shape:
          inverse_indices = tf.reshape(inverse_indices, x_shape)
      return Results(
          tf.cast(output, x.dtype),
          tf.cast(inverse_indices, tf.int64),
          tf.cast(counts, tf.int64),
      )
  
imports: from collections import namedtuple
  from typing import Iterable, Union, Optional, Sequence, Tuple, NamedTuple, List, Literal, Callable, Any
  from numbers import Number
  import tensorflow
  from ivy.func_wrapper import with_unsupported_dtypes
  from ..None import backend_version
  import ivy
  from ivy.functional.ivy.experimental.manipulation import _to_tf_padding
label_desc: Use image node_id 23 for calling a global function with example usage: unique_consecutive() and returns: Results