code: def gather_nd_helper(params, indices):
      indices_shape = tf.shape(indices)
      params_shape = tf.shape(params)
      num_index_dims = indices_shape[-1]
      result_dim_sizes_list = [
          tf.math.reduce_prod(params_shape[i + 1 :])
          for i in range(len(params_shape) - 1)
      ] + [1]
      result_dim_sizes = tf.convert_to_tensor(
          result_dim_sizes_list, dtype=indices.dtype
      )
      implicit_indices_factor = result_dim_sizes[num_index_dims - 1]
      flat_params = tf.reshape(params, (-1,))
      new_shape = [1] * (len(indices_shape) - 1) + [num_index_dims]
      indices_scales = tf.reshape(
          result_dim_sizes[0:num_index_dims], new_shape
      )
      indices_for_flat_tiled = tf.reshape(
          tf.reduce_sum(indices * indices_scales, -1, keepdims=True),
          (-1, 1),
      )
      indices_for_flat_tiled = tf.repeat(
          indices_for_flat_tiled, implicit_indices_factor, axis=1
      )
      implicit_indices = tf.repeat(
          tf.expand_dims(tf.range(implicit_indices_factor), 0),
          indices_for_flat_tiled.shape[0],
          axis=0,
      )
      indices_for_flat = indices_for_flat_tiled + implicit_indices
      flat_indices_for_flat = tf.reshape(indices_for_flat, (-1,))
      flat_gather = tf.gather(flat_params, flat_indices_for_flat)
      res = tf.reshape(
          flat_gather,
          tf.concat(
              [indices_shape[:-1], params_shape[num_index_dims:]], 0
          ),
      )
      return res
  
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 11 for calling a global function with example usage: gather_nd_helper(params, indices) and returns: res