class_docstr: Resize the spatial (last two) dimensions to the specified target size
  using nearest neighbor interpolation. Although this op is similar to
  ``upsample_nearest_neighbor``, ``resize_nearest_neighbor`` works with
  a target size rather than with scale factors.
  
  Parameters
  ----------
  x: tensor<[\*D, H1, W1], T> (Required)
      * Must be at least rank ``3``.
  target_size_height: const<int32> (Required)
      * Target spatial size for the height dimension (``axis=-2``).
  target_size_width: const<int32> (Required)
      * Target spatial size for the width dimension (``axis=-1``).
  
  Notes
  -----
  See ``resize_bilinear`` for examples.
  
  See Also
  --------
  resize_bilinear
  
  Returns
  -------
  tensor<[\*D, H2, W2], T>
      * Tensor with same type as the input.
      * ``H2`` = ``target_size_height``.
      * ``W2`` = ``target_size_width``.
  
  Attributes
  ----------
  T: fp16, fp32
class_docstr_tok: ["Resize","the","spatial","(","last","two",")","dimensions","to","the","specified","target","size","using","nearest","neighbor","interpolation",".","Although","this","op","is","similar","to","``","upsample_nearest_neighbor","``",",","``","resize_nearest_neighbor","``","works","with","a","target","size","rather","than","with","scale","factors",".","Parameters","--","--","--","--","--","x",":","tensor","<","[","\\","*","D",",","H1",",","W1","]",",","T",">","(","Required",")","*","Must","be","at","least","rank","``","3","``",".","target_size_height",":","const","<","int32",">","(","Required",")","*","Target","spatial","size","for","the","height","dimension","(","``","axis=-2","``",")",".","target_size_width",":","const","<","int32",">","(","Required",")","*","Target","spatial","size","for","the","width","dimension","(","``","axis=-1","``",")",".","Notes","--","--","-","See","``","resize_bilinear","``","for","examples",".","See","Also","--","--","--","--","resize_bilinear","Returns","--","--","--","-","tensor","<","[","\\","*","D",",","H2",",","W2","]",",","T",">","*","Tensor","with","same","type","as","the","input",".","*","``","H2","``","=","``","target_size_height","``",".","*","``","W2","``","=","``","target_size_width","``",".","Attributes","--","--","--","--","--","T",":","fp16",",","fp32"]
code: def type_inference(self):
      if self.x.rank < 3:
          raise ValueError(
              'input to the "resize_nearest_neighbor" op must have rank at least 3'
          )
  
      ret_shape = list(self.x.shape)
      ret_shape[-1] = int(self.target_size_width.val)
      ret_shape[-2] = int(self.target_size_height.val)
      return types.tensor(self.x.dtype, ret_shape)
  
imports: import numpy
  from coremltools.converters.mil.mil import DefaultInputs, InputSpec, Operation, TensorInputType, get_new_symbol, types
  from coremltools.converters.mil.mil.ops.defs._op_reqs import register_op
  from coremltools.converters.mil.mil.ops.defs.iOS15 import _IOS15_TARGET
  from coremltools.converters.mil.mil.types.symbolic import is_symbolic
label_desc: Use image node_id 1 for calling the resize_nearest_neighbor obj's underlying member method code with example usage: obj.type_inference() and returns: types