class_docstr: Upsample the spatial dimensions (last two dimensions) of the input
  by scale factors using bilinear interpolation.
  The upsample_bilinear operation in MIL corresponds to the ``recompute_scale_factor=True``
  mode in the pyorch bilinear interpolation op. That is,
  the scale factor is recomputed by the output size.
  Note that when the ``scale_factor_height`` and ``scale_factor_width`` are floating point, this
  could result in a different scale factor due to rounding.
  
  Parameters
  ----------
  x: tensor<[\*D, H1, W1], T>  (Required)
      * Must be at least rank ``3``.
  scale_factor_height: const<U> (Optional, default=1)
      * Scale factor for the height dimension (``axis=-2``).
  scale_factor_width: const<U> (Optional, default=1)
      * Scale factor for the width dimension (``axis=-1``).
  align_corners: const<bool> (Optional, default=True)
      * This parameter determines how samples are chosen for bilinear
        interpolation. For details, see the Notes section.
  
  Notes
  -----
  To understand the ``align_corners`` parameter, consider the 1-D case.
  You need to sample a grid of pixels whose values are computed using linear
  interpolation. This parameter controls how the grid is sampled. If the
  input grid is ``[0, Xin-1]`` (corresponding to an input size of ``Xin``),
  and if the output size is ``Xout``, then the grid points are sampled in
  the following manner:
  
  .. sourcecode:: python
  
      # If align_corners == True:
      spacing = (Xin - 1) / (Xout - 1)
      grid_point[i] = min(Xin - 1, max(0, i*spacing)), for i=0,1,...,Xout-1
  
      # If align_corners == False:
      spacing = Xin / Xout
      grid_point[i] = min(Xin - 1, max(0, i*spacing + 0.5*spacing - 0.5)),
      ...   for i=0,1,...,Xout-1
  
  For example:
  
  .. sourcecode:: python
  
      Xin = 2
      input_interval = [0,1]
  
  Grid points:
  
  .. sourcecode:: python
  
      [0., 0.1, 0.5, 0.9, 1.] (Xout = 5, align_corners=False)
      [0., 0.25, 0.5, 0.75, 1.] (Xout = 5, align_corners=True)
      [0., 0., 0.33, 0.67, 1., 1.] (Xout = 6, align_corners=False)
      [0., 0.2, 0.4, 0.6, 0.8, 1.] (Xout = 6, align_corners=True)
  
  Note the following similarities:
  
  * ``align_corners=False`` is the same as
    ``tf.raw_ops.ResizeBilinear(align_corners=False, half_pixel_centers=True)``.
  
  * ``align_corners=True`` is the same as
    ``tf.raw_ops.ResizeBilinear(align_corners=True, half_pixel_centers=False)``.
  
  Returns
  -------
  tensor<[\*D, H2, W2], T>
      * Tensor with same type as the input.
      * ``H2`` = floor(``H1`` * ``scale_factor_height``).
      * ``W2`` = floor(``W1`` * ``scale_factor_width``).
  
  Attributes
  ----------
  T: fp16, fp32
  U : fp32, i32
class_docstr_tok: ["Upsample","the","spatial","dimensions","(","last","two","dimensions",")","of","the","input","by","scale","factors","using","bilinear","interpolation",".","The","upsample_bilinear","operation","in","MIL","corresponds","to","the","``","recompute_scale_factor=True","``","mode","in","the","pyorch","bilinear","interpolation","op",".","That","is",",","the","scale","factor","is","recomputed","by","the","output","size",".","Note","that","when","the","``","scale_factor_height","``","and","``","scale_factor_width","``","are","floating","point",",","this","could","result","in","a","different","scale","factor","due","to","rounding",".","Parameters","--","--","--","--","--","x",":","tensor","<","[","\\","*","D",",","H1",",","W1","]",",","T",">","(","Required",")","*","Must","be","at","least","rank","``","3","``",".","scale_factor_height",":","const","<","U",">","(","Optional",",","default=1",")","*","Scale","factor","for","the","height","dimension","(","``","axis=-2","``",")",".","scale_factor_width",":","const","<","U",">","(","Optional",",","default=1",")","*","Scale","factor","for","the","width","dimension","(","``","axis=-1","``",")",".","align_corners",":","const","<","bool",">","(","Optional",",","default=True",")","*","This","parameter","determines","how","samples","are","chosen","for","bilinear","interpolation",".","For","details",",","see","the","Notes","section",".","Notes","--","--","-","To","understand","the","``","align_corners","``","parameter",",","consider","the","1-D","case",".","You","need","to","sample","a","grid","of","pixels","whose","values","are","computed","using","linear","interpolation",".","This","parameter","controls","how","the","grid","is","sampled",".","If","the","input","grid","is","``","[","0",",","Xin-1","]","``","(","corresponding","to","an","input","size","of","``","Xin","``",")",",","and","if","the","output","size","is","``","Xout","``",",","then","the","grid","points","are","sampled","in","the","following","manner",":","..","sourcecode",":",":","python","#","If","align_corners","==","True",":","spacing","=","(","Xin","-","1",")","\/","(","Xout","-","1",")","grid_point","[","i","]","=","min","(","Xin","-","1",",","max","(","0",",","i","*","spacing",")",")",",","for","i=0,1",",","...",",","Xout-1","#","If","align_corners","==","False",":","spacing","=","Xin","\/","Xout","grid_point","[","i","]","=","min","(","Xin","-","1",",","max","(","0",",","i","*","spacing","+","0.5","*","spacing","-","0.5",")",")",",","...","for","i=0,1",",","...",",","Xout-1","For","example",":","..","sourcecode",":",":","python","Xin","=","2","input_interval","=","[","0,1","]","Grid","points",":","..","sourcecode",":",":","python","[","0.",",","0.1",",","0.5",",","0.9",",","1",".","]","(","Xout","=","5",",","align_corners=False",")","[","0.",",","0.25",",","0.5",",","0.75",",","1",".","]","(","Xout","=","5",",","align_corners=True",")","[","0.",",","0.",",","0.33",",","0.67",",","1.",",","1",".","]","(","Xout","=","6",",","align_corners=False",")","[","0.",",","0.2",",","0.4",",","0.6",",","0.8",",","1",".","]","(","Xout","=","6",",","align_corners=True",")","Note","the","following","similarities",":","*","``","align_corners=False","``","is","the","same","as","``","tf.raw_ops.ResizeBilinear","(","align_corners=False",",","half_pixel_centers=True",")","``",".","*","``","align_corners=True","``","is","the","same","as","``","tf.raw_ops.ResizeBilinear","(","align_corners=True",",","half_pixel_centers=False",")","``",".","Returns","--","--","--","-","tensor","<","[","\\","*","D",",","H2",",","W2","]",",","T",">","*","Tensor","with","same","type","as","the","input",".","*","``","H2","``","=","floor","(","``","H1","``","*","``","scale_factor_height","``",")",".","*","``","W2","``","=","floor","(","``","W1","``","*","``","scale_factor_width","``",")",".","Attributes","--","--","--","--","--","T",":","fp16",",","fp32","U",":","fp32",",","i32"]
code: def type_inference(self):
      if self.x.rank < 3:
          raise ValueError(
              'input to the "upsample_bilinear" op must have rank at least 3'
          )
  
      ret_shape = list(self.x.shape)
      ret_shape[-1] = (
          np.floor(self.scale_factor_width.val * ret_shape[-1])
          if not is_symbolic(ret_shape[-1])
          else get_new_symbol()
      )
      ret_shape[-2] = (
          np.floor(self.scale_factor_height.val * ret_shape[-2])
          if not is_symbolic(ret_shape[-2])
          else get_new_symbol()
      )
      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 2 for calling the upsample_bilinear obj's underlying member method code with example usage: obj.type_inference() and returns: types