code: def test_resize_invalid_parameter(self, compute_unit, backend):
      def build_invalid_interpolation_mode(x):
          return mb.resize(
              x=x,
              shape=[1, 1, 5],
              resized_dims=np.uint32(2),
              interpolation_mode="DUMMY",
              sampling_mode="DEFAULT",
          )
  
      def build_invalid_sampling_mode(x):
          return mb.resize(
              x=x,
              shape=[1, 1, 5],
              resized_dims=np.uint32(2),
              interpolation_mode="LINEAR",
              sampling_mode="DUMMY",
          )
  
      def build_invalid_target_shape(x):
          return mb.resize(
              x=x,
              shape=[1, 1, 1, 5],
              resized_dims=np.uint32(2),
              interpolation_mode="LINEAR",
              sampling_mode="DEFAULT",
          )
  
      x_val = np.array([0, 1], dtype=np.float32).reshape([1, 1, 2])
      input_placeholder_dict = {"x": mb.placeholder(shape=x_val.shape)}
      input_value_dict = {"x": x_val}
  
      with pytest.raises(
          ValueError, match="Invalid interpolation_mode"
      ):
          run_compare_builder(
              build_invalid_interpolation_mode,
              input_placeholder_dict,
              input_value_dict,
              compute_unit=compute_unit,
              backend=backend,
          )
  
      with pytest.raises(ValueError, match="Invalid sampling_mode"):
          run_compare_builder(
              build_invalid_sampling_mode,
              input_placeholder_dict,
              input_value_dict,
              compute_unit=compute_unit,
              backend=backend,
          )
  
      with pytest.raises(
          ValueError,
          match="The shape's size \(4\) must <= x's rank \(3\)",
      ):
          run_compare_builder(
              build_invalid_target_shape,
              input_placeholder_dict,
              input_value_dict,
              compute_unit=compute_unit,
              backend=backend,
          )
  
imports: import itertools
  import numpy
  import pytest
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import types
  from coremltools.converters.mil.mil.ops.tests.iOS15.test_image_resizing import TestResample
  from coremltools.converters.mil.mil.ops.tests.iOS17 import backends
  from coremltools.converters.mil.mil.ops.tests.testing_utils import UNK_SYM, run_compare_builder
  from coremltools.converters.mil.testing_reqs import compute_units
label_desc: Use image node_id 5 for calling the TestResize obj's underlying member method code with example usage: obj.test_resize_invalid_parameter(compute_unit, backend) and returns: mb, mb, mb