code: def test_resize_bilinear(self, cpu_only=False):
      def get_coreml_model_resize_bilinear(X, params):
          eval = True
          mlmodel = None
          try:
              input_dim = X.shape[2:]
              input_features = [("data", datatypes.Array(*input_dim))]
              output_features = [("output", None)]
              builder = neural_network.NeuralNetworkBuilder(
                  input_features, output_features
              )
              if params["align_corners"]:
                  mode = "STRICT_ALIGN_ENDPOINTS_MODE"
              else:
                  mode = "UPSAMPLE_MODE"
              builder.add_resize_bilinear(
                  "resize",
                  "data",
                  "output",
                  target_height=params["Hnew"],
                  target_width=params["Wnew"],
                  mode=mode,
              )
  
              if cpu_only:
                  compute_unit = ComputeUnit.CPU_ONLY
              else:
                  compute_unit = ComputeUnit.ALL
  
              mlmodel = MLModel(
                  builder.spec, compute_units=compute_unit
              )
          except RuntimeError as e:
              print(e)
              eval = False
  
          return mlmodel, eval
  
      def get_tf_predictions_resize_bilinear(X, params):
          y = tf.compat.v1.image.resize_bilinear(
              X,
              size=[params["Hnew"], params["Wnew"]],
              align_corners=params["align_corners"],
          )
          return y.numpy()
  
      """
          Define Params
          """
      params_dict = dict(
          H=[1, 3, 10],  # [1,2,3,10]
          W=[1, 3, 10],  # [1,2,3,10]
          Hnew=[1, 2, 6],  # [1,3,6,12,20]
          Wnew=[1, 2, 6],  # [1,3,6,12,20]
          align_corners=[False, True],  # [False, True]
          ch=[1, 5],  # [1,5]
          batch=[1, 3],  # [1, 3]
      )
      params = [
          x for x in list(itertools.product(*params_dict.values()))
      ]
      valid_params = [dict(zip(params_dict.keys(), x)) for x in params]
      print("Total params to be tested: {}".format(len(valid_params)))
      """
          Test
          """
      failed_tests_compile = []
      for i in range(len(valid_params)):
          params = valid_params[i]
          # #print("=========: ", params)
          if i % 100 == 0:
              print(
                  "======================= Testing {}/{}".format(
                      str(i), str(len(valid_params))
                  )
              )
          X = np.round(
              255
              * np.random.rand(
                  params["batch"],
                  params["ch"],
                  params["H"],
                  params["W"],
              )
          )
          tf_preds = get_tf_predictions_resize_bilinear(
              np.transpose(X, [0, 2, 3, 1]), params
          )
          tf_preds = np.transpose(tf_preds, [0, 3, 1, 2])
          coreml_model, eval = get_coreml_model_resize_bilinear(
              np.expand_dims(X, axis=0), params
          )
          if eval is False:
              failed_tests_compile.append(params)
          else:
              input_dict = {"data": np.expand_dims(X, axis=0)}
              ref_output_dict = {
                  "output": np.expand_dims(tf_preds, axis=0)
              }
              self._test_model(
                  input_dict, ref_output_dict, coreml_model
              )
  
      self.assertEqual(failed_tests_compile, [])
  
imports: import itertools
  import unittest
  import numpy
  import pytest
  import coremltools.models.datatypes
  from coremltools import ComputeUnit
  from coremltools._deps import _HAS_TF_2, MSG_TF2_NOT_FOUND
  from coremltools.models import MLModel, neural_network
  from coremltools.models.utils import _is_macos, _macos_version
label_desc: Use image node_id 5 for calling the StressTest obj's underlying member method code with example usage: obj.test_resize_bilinear(cpu_only) and returns: mlmodel,  eval, y