def add_resize_bilinear(
        self,
        name,
        input_name,
        output_name,
        target_height=1,
        target_width=1,
        mode="ALIGN_ENDPOINTS_MODE",
    ):
        """
        Add a resize bilinear layer to the model. A layer that resize the input to a given spatial size using bilinear interpolation.
        Refer to the ``ResizeBilinearLayerParams`` message in the specification (NeuralNetwork.proto) for more details.

        Parameters
        ----------
        name: str
            The name of this layer.
        input_name: str
            The input blob name of this layer.
        output_name: str
            The output blob name of this layer.
        target_height: int
            Output height dimension.
        target_width: int
            Output width dimension.
        mode: str
            Following values are supported: 'STRICT_ALIGN_ENDPOINTS_MODE', 'ALIGN_ENDPOINTS_MODE', 'UPSAMPLE_MODE', 'ROI_ALIGN_MODE'.
            This parameter determines the sampling grid used for bilinear interpolation.

        See Also
        --------
        add_upsample
        """
        spec_layer = self._add_generic_layer(name, [input_name], [output_name])
        spec_layer_params = spec_layer.resizeBilinear
        spec_layer_params.targetSize.append(target_height)
        spec_layer_params.targetSize.append(target_width)
        mode = mode.upper() if isinstance(mode, str) else mode
        if mode == "ALIGN_ENDPOINTS_MODE":

            spec_layer_params.mode.samplingMethod = (
                _proto.NeuralNetwork_pb2.SamplingMode.Method.Value("ALIGN_ENDPOINTS_MODE")
            )
        elif mode == "STRICT_ALIGN_ENDPOINTS_MODE":
            spec_layer_params.mode.samplingMethod = (
                _proto.NeuralNetwork_pb2.SamplingMode.Method.Value("STRICT_ALIGN_ENDPOINTS_MODE")
            )
        elif mode == "UPSAMPLE_MODE":
            spec_layer_params.mode.samplingMethod = (
                _proto.NeuralNetwork_pb2.SamplingMode.Method.Value("UPSAMPLE_MODE")
            )
        elif mode == "ROI_ALIGN_MODE":
            spec_layer_params.mode.samplingMethod = (
                _proto.NeuralNetwork_pb2.SamplingMode.Method.Value("ROI_ALIGN_MODE")
            )
        else:
            raise ValueError("Unsupported resize bilinear mode %s" % mode)
        return spec_layer

        Add a resize bilinear layer to the model. A layer that resize the input to a given spatial size using bilinear interpolation.
        Refer to the ``ResizeBilinearLayerParams`` message in the specification (NeuralNetwork.proto) for more details.

        Parameters
        ----------
        name: str
            The name of this layer.
        input_name: str
            The input blob name of this layer.
        output_name: str
            The output blob name of this layer.
        target_height: int
            Output height dimension.
        target_width: int
            Output width dimension.
        mode: str
            Following values are supported: 'STRICT_ALIGN_ENDPOINTS_MODE', 'ALIGN_ENDPOINTS_MODE', 'UPSAMPLE_MODE', 'ROI_ALIGN_MODE'.
            This parameter determines the sampling grid used for bilinear interpolation.

        See Also
        --------
        add_upsample
        
coremltools/models/neural_network/builder.py