code: def gather_nd(
      params: np.ndarray,
      indices: np.ndarray,
      /,
      *,
      batch_dims: int = 0,
      out: Optional[np.ndarray] = None,
  ) -> np.ndarray:
      ivy.utils.assertions.check_gather_nd_input_valid(
          params, indices, batch_dims
      )
      batch_dims %= len(params.shape)
      result = []
      if batch_dims == 0:
          result = gather_nd_helper(params, indices)
      else:
          for b in range(batch_dims):
              if b == 0:
                  zip_list = [(p, i) for p, i in zip(params, indices)]
              else:
                  zip_list = [
                      (p, i)
                      for z in [zip(p1, i1) for p1, i1 in zip_list]
                      for p, i in z
                  ]
          for z in zip_list:
              p, i = z
              r = gather_nd_helper(p, np.asarray(i, indices.dtype))
              result.append(r)
          result = np.array(result)
          result = result.reshape(
              [*params.shape[0:batch_dims], *result.shape[1:]]
          )
      return result
  
imports: from typing import Optional, Union, Sequence, Callable, Tuple
  import numpy
  from operator import mul
  from functools import reduce
  import multiprocessing
  from numbers import Number
  import ivy
  from ivy.functional.backends.numpy.helpers import _scalar_output_to_0d_array
  from ivy.func_wrapper import with_unsupported_dtypes
  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() and returns: result