code: def type_inference(self):
      if self.x.rank < 2:
          raise ValueError(
              'input to the "crop" op must at least be of rank 2. Provided {}'.format(
                  self.x.rank
              )
          )
  
      crop_height = self.crop_height.val
      crop_width = self.crop_width.val
  
      if len(crop_height.flatten()) != 2:
          raise ValueError(
              "crop_height must have 2 elements. Provided {}".format(
                  len(crop_height.flatten())
              )
          )
  
      if len(crop_width.flatten()) != 2:
          raise ValueError(
              "crop_width must have 2 elements. Provided {}".format(
                  len(crop_width.flatten())
              )
          )
  
      input_shape = list(self.x.shape)
      ret_shape = (
          input_shape[:-2]
          + [input_shape[-2] - crop_height[0] - crop_height[1]]
          + [input_shape[-1] - crop_width[0] - crop_width[1]]
      )
      return types.tensor(self.x.dtype, ret_shape)
  
imports: from ._op_reqs import *
label_desc: Use image node_id 2 for calling the crop obj's underlying member method code with example usage: obj.type_inference() and returns: types