code: def check_gather_nd_input_valid(params, indices, batch_dims):
      if batch_dims >= len(params.shape):
          raise ivy.utils.exceptions.IvyException(
              f"batch_dims = {batch_dims} must be less than rank(`params`) ="
              f" {len(params.shape)}."
          )
      if batch_dims >= len(indices.shape):
          raise ivy.utils.exceptions.IvyException(
              f"batch_dims = {batch_dims}  must be less than rank(`indices`) ="
              f" {len(indices.shape)}."
          )
      if params.shape[0:batch_dims] != indices.shape[0:batch_dims]:
          raise ivy.utils.exceptions.IvyException(
              "batch dimensions must match in `params` and `indices`; saw"
              f" {params.shape[0:batch_dims]} vs. {indices.shape[0:batch_dims]}"
          )
      if indices.shape[-1] > (len(params.shape[batch_dims:])):
          raise ivy.utils.exceptions.IvyException(
              "index innermost dimension length must be <= rank(`params[batch_dims:]`);"
              f" saw: {indices.shape[-1]} vs. {len(params.shape[batch_dims:])} ."
          )
  
imports: import ivy
label_desc: Use image node_id 17 for calling a global function with example usage: check_gather_nd_input_valid(params, indices, batch_dims) without return types