code: def gather(
      params: Union[tf.Tensor, tf.Variable],
      indices: Union[tf.Tensor, tf.Variable],
      /,
      *,
      axis: int = -1,
      batch_dims: int = 0,
      out: Optional[Union[tf.Tensor, tf.Variable]] = None,
  ) -> Union[tf.Tensor, tf.Variable]:
      axis %= len(params.shape)
      batch_dims %= len(params.shape)
      ivy.utils.assertions.check_gather_input_valid(
          params, indices, axis, batch_dims
      )
      return tf.gather(
          params, indices, axis=axis, batch_dims=batch_dims
      )
  
imports: from typing import Optional, Union, Sequence, Callable, Tuple
  import numpy
  import multiprocessing
  from numbers import Number
  import tensorflow
  import ivy
  from ivy.functional.ivy.gradients import _is_variable
  from ivy.func_wrapper import with_unsupported_dtypes
  from ivy.utils.exceptions import _check_inplace_update_support
  from .None import backend_version
  from ...ivy.general import _broadcast_to
label_desc: Use image node_id 10 for calling a global function with example usage: gather() and returns: tf