code: def test_affine_transform(
      self, compute_unit, backend, InputShape_OutputShape, op
  ):
      if backend[0] == "neuralnetwork":
          pytest.skip(
              "Affine op not available in the neuralnetwork backend"
          )
  
      input_shape, output_shape = InputShape_OutputShape
      batch_size = input_shape[0]
      transforms = np.random.rand(batch_size, 8) - 0.05
      transforms[:, 6:8] = 0
  
      @make_tf_graph([input_shape])
      def build_model(x):
          if op == "V2":
              return tf.raw_ops.ImageProjectiveTransformV2(
                  images=x,
                  transforms=transforms,
                  fill_mode="CONSTANT",
                  output_shape=(output_shape[0], output_shape[1]),
                  interpolation="BILINEAR",
              )
          elif op == "V3":
              return tf.raw_ops.ImageProjectiveTransformV3(
                  images=x,
                  transforms=transforms,
                  fill_mode="CONSTANT",
                  output_shape=(output_shape[0], output_shape[1]),
                  interpolation="BILINEAR",
                  fill_value=0.0,
              )
          else:
              raise ValueError(
                  "tensorflow op {} not supported".format(op)
              )
  
      model, inputs, outputs = build_model
      input_values = [np.random.rand(*input_shape).astype(np.float32)]
      input_dict = dict(zip(inputs, input_values))
      TensorFlowBaseTest.run_compare_tf(
          model,
          input_dict,
          outputs,
          compute_unit=compute_unit,
          backend=backend,
      )
  
imports: import itertools
  import numpy
  import pytest
  import coremltools
  from coremltools.converters.mil import testing_reqs
  from coremltools.converters.mil.frontend.tensorflow.test.testing_utils import TensorFlowBaseTest
  from coremltools.converters.mil.frontend.tensorflow2.test.testing_utils import TensorFlow2BaseTest
  from coremltools.converters.mil.frontend.tensorflow2.test.testing_utils import make_tf2_graph
  from coremltools.converters.mil.testing_utils import random_gen
label_desc: Use image node_id 2 for calling the TestImageTransform obj's underlying member method code with example usage: obj.test_affine_transform(compute_unit, backend, InputShape_OutputShape, op) and returns: tf, tf