code: def test_conv(
      self,
      use_cpu_only,
      backend,
      op,
      padding,
      data_format,
      spatial_dim_and_ks,
      strides,
      dilations,
      batch_size,
  ):
      s1, s2, s3, k1, k2, k3 = spatial_dim_and_ks
      c_in, c_out = 2, 3
      input_shape = None
      kernel_size = None
      if op in {
          tf.keras.layers.Conv1D,
          tf.keras.layers.LocallyConnected1D,
      }:
          input_shape = (batch_size, s3, c_in)
          kernel_size = k3
          strides = strides[2]
          dilations = dilations[2]
      elif op in {
          tf.keras.layers.Conv2D,
          tf.keras.layers.LocallyConnected2D,
      }:
          input_shape = (batch_size, s2, s3, c_in)
          kernel_size = (k2, k3)
          strides = (strides[1], strides[2])
          dilations = dilations[1:]
      elif op == tf.keras.layers.Conv3D:
          input_shape = (batch_size, s1, s2, s3, c_in)
          kernel_size = (k1, k2, k3)
  
      if op in {
          tf.keras.layers.LocallyConnected1D,
          tf.keras.layers.LocallyConnected2D,
      }:
          if padding != "valid":
              return  # tf.keras only supports "valid"
          model = tf.keras.Sequential(
              [
                  op(
                      batch_input_shape=input_shape,
                      filters=c_out,
                      kernel_size=kernel_size,
                      strides=strides,
                      padding=padding.upper(),
                      data_format=data_format,
                  )
              ]
          )
      else:
          model = tf.keras.Sequential(
              [
                  op(
                      batch_input_shape=input_shape,
                      filters=c_out,
                      kernel_size=kernel_size,
                      strides=strides,
                      padding=padding.upper(),
                      data_format=data_format,
                      dilation_rate=dilations,
                  )
              ]
          )
  
      run_compare_tf_keras(
          model,
          [random_gen(input_shape, rand_min=-10, rand_max=10)],
          use_cpu_only=use_cpu_only,
          backend=backend,
      )
  
imports: import random
  from coremltools.converters.mil import testing_reqs
  from coremltools.converters.mil.frontend.tensorflow2.test.testing_utils import run_compare_tf_keras
  from coremltools.converters.mil.testing_reqs import *
label_desc: Use image node_id 1 for calling the TestConvolution obj's underlying member method code with example usage: obj.test_conv(use_cpu_only, backend, op, padding, data_format, spatial_dim_and_ks, strides, dilations, batch_size) without return types