class_docstr: Resize the spatial (last two) dimensions to the specified target size
  using bilinear interpolation. Although this op is similar to
  ``upsample_bilinear``, ``resize_bilinear`` 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> (Optional, default=1)
      * Target spatial size for the height dimension (``axis=-2``).
  target_size_width: const<int32> (Optional, default=1)
      * Target spatial size for the width dimension (``axis=-1``).
  sampling_mode: const<str> (Optional, default="DEFAULT")
      * This parameter can take ``"STRICT_ALIGN_CORNERS”``, ``"ALIGN_CORNERS"``,
        ``"DEFAULT"``, ``"OFFSET_CORNERS"`` or ``UNALIGN_CORNERS`` as values.
        For details, see the Notes section.
  
  Notes
  -----
  To understand the ``sampling_mode`` 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
  
      # "STRICT_ALIGN_CORNERS":
      spacing = (Xin - 1) / (Xout - 1)
      grid_point[i] = min(Xin-1, max(0, i*spacing)), for i=0,1,...,Xout-1
  
      # "ALIGN_CORNERS": Same as "STRICT_ALIGN_CORNERS" unless Xout=1,
      # in which case:
      grid_point[0] = (Xin-1) / 2, if Xout==1
  
      # "DEFAULT":
      spacing = (Xin - Xin/Xout) / (Xout - 1)
      grid_point[i] = min(Xin-1, max(0, i*spacing)), for i=0,1,...,Xout-1
  
      # "OFFSET_CORNERS":
      delta = max(1, Xin - 1) / Xout
      spacing = ((Xout - 1) * delta) / (Xout - 1)
      grid_point[i] = min(Xin-1, max(0, 0.5*delta + i*spacing)), for
      ...   i=0,1,...,Xout-1
  
      # "UNALIGN_CORNERS":
      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, UNALIGN_CORNERS)
      [0., 0.25, 0.5, 0.75, 1.] (Xout = 5, "STRICT_ALIGN_CORNERS" / "ALIGN_CORNERS")
      [0., 0.4, 0.8, 1., 1.] (Xout = 5, "DEFAULT")
      [0.1, 0.3, 0.5, 0.7, 0.9] (Xout = 5, "OFFSET_CORNERS")
  
      [0., 0., 0.33, 0.67, 1., 1.] (Xout = 6, UNALIGN_CORNERS)
      [0., 0.2, 0.4, 0.6, 0.8, 1.] (Xout = 6, "STRICT_ALIGN_CORNERS" / "ALIGN_CORNERS")
      [0., 0.33, 0.67, 1., 1., 1.] (Xout = 6, "DEFAULT")
      [0.08, 0.25, 0.42, 0.58, 0.75, 0.92] (Xout = 6, "OFFSET_CORNERS")
  
  Note the following similarities:
  
      * ``"DEFAULT"`` is same as
        ``tf.raw_ops.ResizeBilinear(align_corners=False,
        half_pixel_centers=False)``.
      * ``"STRICT_ALIGN_CORNERS"`` is 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`` = ``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","bilinear","interpolation",".","Although","this","op","is","similar","to","``","upsample_bilinear","``",",","``","resize_bilinear","``","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",">","(","Optional",",","default=1",")","*","Target","spatial","size","for","the","height","dimension","(","``","axis=-2","``",")",".","target_size_width",":","const","<","int32",">","(","Optional",",","default=1",")","*","Target","spatial","size","for","the","width","dimension","(","``","axis=-1","``",")",".","sampling_mode",":","const","<","str",">","(","Optional",",","default=","''","DEFAULT","''",")","*","This","parameter","can","take","``","``","STRICT_ALIGN_CORNERS","\u201d","``",",","``","``","ALIGN_CORNERS","''","``",",","``","``","DEFAULT","''","``",",","``","``","OFFSET_CORNERS","''","``","or","``","UNALIGN_CORNERS","``","as","values",".","For","details",",","see","the","Notes","section",".","Notes","--","--","-","To","understand","the","``","sampling_mode","``","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","#","``","STRICT_ALIGN_CORNERS","''",":","spacing","=","(","Xin","-","1",")","\/","(","Xout","-","1",")","grid_point","[","i","]","=","min","(","Xin-1",",","max","(","0",",","i","*","spacing",")",")",",","for","i=0,1",",","...",",","Xout-1","#","``","ALIGN_CORNERS","''",":","Same","as","``","STRICT_ALIGN_CORNERS","''","unless","Xout=1",",","#","in","which","case",":","grid_point","[","0","]","=","(","Xin-1",")","\/","2",",","if","Xout==1","#","``","DEFAULT","''",":","spacing","=","(","Xin","-","Xin\/Xout",")","\/","(","Xout","-","1",")","grid_point","[","i","]","=","min","(","Xin-1",",","max","(","0",",","i","*","spacing",")",")",",","for","i=0,1",",","...",",","Xout-1","#","``","OFFSET_CORNERS","''",":","delta","=","max","(","1",",","Xin","-","1",")","\/","Xout","spacing","=","(","(","Xout","-","1",")","*","delta",")","\/","(","Xout","-","1",")","grid_point","[","i","]","=","min","(","Xin-1",",","max","(","0",",","0.5","*","delta","+","i","*","spacing",")",")",",","for","...","i=0,1",",","...",",","Xout-1","#","``","UNALIGN_CORNERS","''",":","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",",","UNALIGN_CORNERS",")","[","0.",",","0.25",",","0.5",",","0.75",",","1",".","]","(","Xout","=","5",",","``","STRICT_ALIGN_CORNERS","''","\/","``","ALIGN_CORNERS","''",")","[","0.",",","0.4",",","0.8",",","1.",",","1",".","]","(","Xout","=","5",",","``","DEFAULT","''",")","[","0.1",",","0.3",",","0.5",",","0.7",",","0.9","]","(","Xout","=","5",",","``","OFFSET_CORNERS","''",")","[","0.",",","0.",",","0.33",",","0.67",",","1.",",","1",".","]","(","Xout","=","6",",","UNALIGN_CORNERS",")","[","0.",",","0.2",",","0.4",",","0.6",",","0.8",",","1",".","]","(","Xout","=","6",",","``","STRICT_ALIGN_CORNERS","''","\/","``","ALIGN_CORNERS","''",")","[","0.",",","0.33",",","0.67",",","1.",",","1.",",","1",".","]","(","Xout","=","6",",","``","DEFAULT","''",")","[","0.08",",","0.25",",","0.42",",","0.58",",","0.75",",","0.92","]","(","Xout","=","6",",","``","OFFSET_CORNERS","''",")","Note","the","following","similarities",":","*","``","``","DEFAULT","''","``","is","same","as","``","tf.raw_ops.ResizeBilinear","(","align_corners=False",",","half_pixel_centers=False",")","``",".","*","``","``","STRICT_ALIGN_CORNERS","''","``","is","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","``","=","``","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_bilinear" op must have rank at least 3'
          )
  
      if self.sampling_mode.val not in {
          "STRICT_ALIGN_CORNERS",
          "ALIGN_CORNERS",
          "UNALIGN_CORNERS",
          "DEFAULT",
          "OFFSET_CORNERS",
      }:
          raise ValueError(
              '"resize_bilinear" op: unrecognized sampling mode "{}"'.format(
                  self.sampling_mode.val
              )
          )
  
      ret_shape = list(self.x.shape)
      ret_shape[-1] = self.target_size_width.val
      ret_shape[-2] = 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 2 for calling the resize_bilinear obj's underlying member method code with example usage: obj.type_inference() and returns: types