code: def _test_builder_to_backend_smoke(
      compute_unit, backend, coordinates_dtype, expected_cast_ops
  ):
      x_ = np.array([11.0, 22.0, 33.0, 44.0], dtype=np.float32).reshape(
          [1, 1, 2, 2]
      )
      coordinates_ = (
          np.array(
              [-1.0, -2.0, -3.7, -1.0, 0.0, 0.0, 3.5, 1.2],
              dtype=np.float32,
          )
          .reshape([1, 2, 2, 2])
          .astype(coordinates_dtype)
      )
      if np.issubdtype(coordinates_dtype, np.integer):
          coordinates_ = (
              np.array([0, 0, 1, 1, 0, 0, 1, 1])
              .reshape([1, 2, 2, 2])
              .astype(coordinates_dtype)
          )
      expected_output_type = (1, 1, 2, 2, types.fp32)
  
      def build_0(x, coordinates):
          return mb.resample(
              x=x,
              coordinates=coordinates,
              sampling_mode="bilinear",
              padding_mode="constant",
              padding_value=6.17,
              coordinates_mode="normalized_minus_one_to_one",
              align_corners=True,
          )
  
      expected_output_0 = np.array(
          [8.585, 6.17, 27.5, 6.17], dtype=np.float32
      )
      if np.issubdtype(coordinates_dtype, np.integer):
          expected_output_0 = np.array(
              [27.5, 44.0, 27.5, 44.0], dtype=np.float32
          )
      expected_output_0 = expected_output_0.reshape(
          expected_output_type[:-1]
      )
  
      def build_1(x, coordinates):
          return mb.resample(
              x=x,
              coordinates=coordinates,
              sampling_mode="nearest",
              padding_mode="border",
              padding_value=-1.0,
              coordinates_mode="unnormalized",
              align_corners=False,
          )
  
      expected_output_1 = np.array(
          [11.0, 11.0, 11.0, 44.0], dtype=np.float32
      )
      if np.issubdtype(coordinates_dtype, np.integer):
          expected_output_1 = np.array(
              [11.0, 44.0, 11.0, 44.0], dtype=np.float32
          )
      expected_output_1 = expected_output_1.reshape(
          expected_output_type[:-1]
      )
  
      def build_2(x, coordinates):
          return mb.resample(
              x=x,
              coordinates=coordinates,
              sampling_mode="bilinear",
              padding_mode="reflection",
              padding_value=-1.0,
              coordinates_mode="normalized_zero_to_one",
              align_corners=True,
          )
  
      expected_output_2 = np.array(
          [22.0, 36.3, 11.0, 34.1], dtype=np.float32
      )
      if np.issubdtype(coordinates_dtype, np.integer):
          expected_output_2 = np.array(
              [11.0, 44.0, 11.0, 44.0], dtype=np.float32
          )
      expected_output_2 = expected_output_2.reshape(
          expected_output_type[:-1]
      )
  
      def build_3(x, coordinates):
          return mb.resample(
              x=x,
              coordinates=coordinates,
              sampling_mode="nearest",
              padding_mode="symmetric",
              padding_value=-1.0,
              coordinates_mode="normalized_zero_to_one",
              align_corners=False,
          )
  
      expected_output_3 = np.array(
          [22.0, 33.0, 11.0, 33.0], dtype=np.float32
      )
      if np.issubdtype(coordinates_dtype, np.integer):
          expected_output_3 = np.array(
              [11.0, 44.0, 11.0, 44.0], dtype=np.float32
          )
      expected_output_3 = expected_output_3.reshape(
          expected_output_type[:-1]
      )
  
      for build, expected_output in zip(
          [build_0, build_1, build_2, build_3],
          [
              expected_output_0,
              expected_output_1,
              expected_output_2,
              expected_output_3,
          ],
      ):
          # Need to create placeholders inside for loop to avoid interfere with each other.
          input_placeholder_dict = {
              "x": mb.placeholder(shape=x_.shape),
              "coordinates": mb.placeholder(
                  shape=coordinates_.shape,
                  dtype=types.numpy_type_to_builtin_type(
                      coordinates_dtype
                  ),
              ),
          }
          input_value_dict = {"x": x_, "coordinates": coordinates_}
  
          mlmodel = run_compare_builder(
              build,
              input_placeholder_dict,
              input_value_dict,
              expected_output_type,
              expected_output,
              compute_unit=compute_unit,
              backend=backend,
          )
          prog = mlmodel._mil_program
          number_of_cast = len(prog["main"].find_ops(op_type="cast"))
          assert number_of_cast == expected_cast_ops
  
imports: import itertools
  import numpy
  import pytest
  import coremltools
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import get_new_symbol, types
  from coremltools.converters.mil.mil.ops.tests.iOS15 import backends
  from coremltools.converters.mil.mil.ops.tests.testing_utils import mark_api_breaking, run_compare_builder
  from coremltools.converters.mil.testing_reqs import compute_units
label_desc: Use image node_id 1 for calling the TestResample obj's underlying member method code with example usage: obj._test_builder_to_backend_smoke(compute_unit, backend, coordinates_dtype, expected_cast_ops) and returns: mb, mb, mb, mb