code: def spatial_dimensions_out_shape(
      pad_type,
      input_shape,
      kernel_shape,
      strides,
      dilations=None,
      custom_pad=None,
  ):
      """
      Args
          pad_type: string. Must be one of ('same', 'valid', 'custom')
  
          input_shape: [iH, iW, ...]: spatial input dims (excluding channels)
              Required iff pad_type == 'same'
  
          kernel_shape: [kH, kW, ...]: spatial kernel dims (excluding channels)
  
          strides: [sH, sW, ...]: spatial strides (excluding channels)
              Required iff pad_type == 'same'
  
          dilations: [dH, dW, ...]: dilations (excluding channels)
              If not provided, defaults to [1, 1, ...], effectively no dilation.
  
          custom_pad: Required iff pad_type == 'custom'.
              custom_pad[2*i], custom_pad[2*i+1] are before/after custom padding
              for spatial dim i.
  
  
      Returns:
          A list of spatial output sizes for each spatial dimension of kernel_shape.
  
      """
      num_spatial_dims = len(kernel_shape)
      if dilations is None:
          dilations = [1] * num_spatial_dims
      if custom_pad is None:
          custom_pad = [0] * num_spatial_dims * 2
      if not (
          len(input_shape)
          == len(kernel_shape)
          == len(strides)
          == len(dilations)
          == len(custom_pad) / 2
      ):
          raise ValueError(
              "input_shape (length {}), kernel_shape (length {}), "
              "strides (length {}), dilations (length {}), and "
              "custom_pad (length {}) divided by two must all be "
              "the same length".format(
                  len(input_shape),
                  len(kernel_shape),
                  len(strides),
                  len(dilations),
                  len(custom_pad),
              )
          )
      pad = aggregated_pad(
          pad_type=pad_type,
          kernel_shape=kernel_shape,
          input_shape=input_shape,
          strides=strides,
          dilations=dilations,
          custom_pad=custom_pad,
      )
      effective_ks = effective_kernel(kernel_shape, dilations)
      return [
          (input_shape[r] + pad[r] - effective_ks[r]) // strides[r] + 1
          for r in range(num_spatial_dims)
      ]
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/coremltools/converters/mil/mil/ops/defs/_utils.py
imports: import math
  import coremltools.converters
  import sympy
  from coremltools.converters.mil.mil.types.symbolic import is_symbolic
  from ._op_reqs import *
label_desc: Use image node_id 5 for calling a global function with example usage: spatial_dimensions_out_shape(pad_type, input_shape, kernel_shape, strides, dilations, custom_pad) and returns: unknown