code: def check_gather_input_valid(params, indices, axis, batch_dims):
      if batch_dims > axis:
          raise ivy.utils.exceptions.IvyException(
              f"batch_dims ({batch_dims}) must be less than or equal to axis ({axis})."
          )
      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]}"
          )
  
imports: import ivy
label_desc: Use image node_id 16 for calling a global function with example usage: check_gather_input_valid(params, indices, axis, batch_dims) without return types