code: def type_inference(self):
      ksize = self.kernel_sizes.val
      x_shape = self.x.shape
      D_in_rank = len(x_shape) - 2
  
      strides = (
          [1] * D_in_rank if self.strides is None else self.strides.val
      )
      pad_type = (
          "valid"
          if self.pad_type is None
          else self.pad_type.val.lower()
      )
      pad = None if self.pad is None else self.pad.val
      D_in = x_shape[2:]  # spatial dimensions
      D_out_shape = spatial_dimensions_out_shape(
          pad_type=pad_type,
          input_shape=D_in,
          kernel_shape=ksize,
          strides=strides,
          custom_pad=pad,
      )
      ret_shape = list(x_shape[:2]) + D_out_shape
      return types.tensor(self.x.dtype, tuple(ret_shape))
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/coremltools/converters/mil/mil/ops/defs/pool.py
imports: from coremltools.converters.mil.mil.ops.defs._utils import spatial_dimensions_out_shape
  from ._op_reqs import *
label_desc: Use image node_id 2 for calling the Pooling obj's underlying member method code with example usage: obj.type_inference() and returns: types