code: def type_inference(self):
      if self.x.rank != 4:
          raise ValueError(
              'input to the "crop_resize" op must be of rank 4. Provided {}'.format(
                  self.x.rank
              )
          )
  
      if self.roi.rank != 5:
          raise ValueError(
              'ROI input to the "crop_resize" op must be of rank 5, provided {}'.format(
                  self.roi.rank
              )
          )
  
      if self.sampling_mode.val not in {
          "STRICT_ALIGN_CORNERS",
          "ALIGN_CORNERS",
          "DEFAULT",
          "OFFSET_CORNERS",
      }:
          raise ValueError(
              '"crop_resize" op: unrecognized sampling mode "{}"'.format(
                  self.sampling_mode
              )
          )
  
      # ret_shape: [N] + [B, C, h_out, w_out]
      N, B, C = self.roi.shape[0], self.x.shape[0], self.x.shape[1]
      ret_shape = [
          N,
          B,
          C,
          self.target_height.val,
          self.target_width.val,
      ]
      return types.tensor(self.x.dtype, ret_shape)
  
imports: from ._op_reqs import *
label_desc: Use image node_id 2 for calling the crop_resize obj's underlying member method code with example usage: obj.type_inference() and returns: types