code: def gather(
      params,
      indices,
      validate_indices=None,
      name=None,
      axis=None,
      batch_dims=0,
  ):
      """tf.gather for structured tensors.
  
      Does not support (yet) checks on illegal axis values, et cetera.
  
      Indices must be a ragged or dense tensor.
      Args:
        params: a structured tensor to be gathered
        indices: a ragged tensor or tensor to gather by.
        validate_indices: whether to validate the indices
        name: the name of the op(s).
        axis: the axis in params to gather on.
        batch_dims: the number of batch dimensions.
  
      Returns:
        the params reorganized according to indices.
      """
      if name is None:
          name = "gather"
      with ops.name_scope(name):
          if axis is None:
              axis = batch_dims
          axis = array_ops.get_positive_axis(
              axis, params.shape.rank, ndims_name="params.shape.rank"
          )
          indices = ragged_tensor.convert_to_tensor_or_ragged_tensor(
              indices, name="indices"
          )
  
          def leaf_op(p):
              return array_ops.gather(
                  p,
                  indices,
                  validate_indices=validate_indices,
                  axis=axis,
                  batch_dims=batch_dims,
                  name=None,
              )
  
          return _extend_op_single(params, leaf_op)
  
imports: from typing import Sequence
  from tensorflow.core.config import flags
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.ops.ragged import dynamic_ragged_shape
  from tensorflow.python.ops.ragged import ragged_tensor
  from tensorflow.python.ops.ragged.row_partition import RowPartition
  from tensorflow.python.ops.structured.structured_tensor import StructuredTensor
  from tensorflow.python.util import deprecation
  from tensorflow.python.util import dispatch
label_desc: Use image node_id 5 for calling a global function with example usage: gather(params, indices, validate_indices, name, axis, batch_dims) and returns: _extend_op_single, array_ops