code: def _check_same_batch_size(i, n_samples, result_shape):
      if n_samples != result_shape[0]:
          raise ValueError(
              f"Tensor {i} has a batch-size of {n_samples} but those before had a"
              f" batch-size of {result_shape[0]}, all tensors should have the"
              " same batch-size."
          )
  
imports: import logging
  from typing import Union, Optional, Tuple, List, Sequence, Literal
  import ivy
  from ivy.utils.backend import current_backend
  from ivy.func_wrapper import to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_array_function, handle_device, inputs_to_ivy_arrays, handle_backend_invalid
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 30 for calling a global function with example usage: _check_same_batch_size(i, n_samples, result_shape) without return types