code: def _get_output_shape(
      auto_pad: str,
      input_spatial_shape: Tuple[int],
      kernel_spatial_shape: Tuple[int],
      strides_spatial: Tuple[int],
      pad_shape: Optional[Tuple[int]] = None,
      ceil_mode: Optional[int] = 0,
  ) -> Tuple[int]:
      if not ceil_mode:
          out_shape = _get_output_shape_no_ceil(
              auto_pad,
              input_spatial_shape,
              kernel_spatial_shape,
              strides_spatial,
          )
      else:
          round_fct = np.ceil if ceil_mode else np.floor
          out_shape = [0] * len(input_spatial_shape)  # type: ignore
          if auto_pad in ("SAME_UPPER", "SAME_LOWER"):
              for i in range(len(input_spatial_shape)):
                  out_shape[i] = int(  # type: ignore
                      round_fct(float(input_spatial_shape[i]) / float(strides_spatial[i]))  # type: ignore
                  )
          elif auto_pad == "VALID":
              if pad_shape is None:
                  raise ValueError(  # pragma: no cogitver
                      "pad_shape cannot be None if auto_pad is "
                      "'VALID' and ceil_mode is 1."
                  )
              for i in range(len(input_spatial_shape)):
                  out_shape[i] = int(  # type: ignore
                      round_fct(  # type: ignore
                          float(
                              input_spatial_shape[i]
                              + pad_shape[i]
                              - kernel_spatial_shape[i]
                          )
                          / float(strides_spatial[i])
                          + 1
                      )
                  )
      if len(out_shape) == 0:
          raise RuntimeError(
              f"Unable to compute output shape, auto_pad={auto_pad!r}, "
              f"input_spatial_shape={input_spatial_shape!r}, "
              f"kernel_spatial_shape={kernel_spatial_shape!r}, "
              f"strides_spatial={strides_spatial!r}, ceil_mode={ceil_mode!r}."
          )
      if min(out_shape) <= 0:
          raise RuntimeError(
              f"output shape cannot be null or negative, out_shape={out_shape!r}, "
              f"auto_pad={auto_pad!r}, input_spatial_shape={input_spatial_shape!r}, "
              f"kernel_spatial_shape={kernel_spatial_shape!r}, "
              f"strides_spatial={strides_spatial!r}, ceil_mode={ceil_mode!r}."
          )
      return tuple(out_shape)
  
file_path: onnx/onnx/reference/ops/_op_common_pool.py
imports: import itertools
  from typing import Optional, Tuple
  import numpy
  from onnx.reference.op_run import OpRun
  from onnx.reference.ops._op_common_indices import _get_index, _get_indices
label_desc: Use image node_id 3 for calling a global function with example usage: _get_output_shape(auto_pad, input_spatial_shape, kernel_spatial_shape, strides_spatial, pad_shape, ceil_mode) and returns: tuple