code: def test_works_like_conv2d_transpose(
      self,
      input_shape,
      filter_shape,
      channels_out,
      strides,
      padding,
      dilations,
  ):
      strides_tuple = strides
      if not self.unequal_strides_ok:
          if strides[0] != strides[1]:
              # Skip this test case if the method does not support unequal strides.
              return
          else:
              strides = strides[0]
  
      x, k = _make_input_and_kernel(
          self.make_input,
          input_batch_shape=[],
          input_shape=input_shape,
          # Use singleton kernel_batch_shape to avoid the short circuit to
          # `conv2d_transpose`.
          kernel_batch_shape=[1],
          filter_shape=filter_shape,
          channels_out=channels_out,
          dtype=self.dtype,
      )
  
      output_shape, strides_ = convolution_util._get_output_shape(
          rank=2,
          strides=strides_tuple,
          padding=padding,
          dilations=dilations,
          input_shape=input_shape,
          output_size=channels_out,
          filter_shape=filter_shape,
      )
  
      tf_kernel = tf.transpose(
          tf.reshape(
              k,
              ps.concat(
                  [filter_shape, [input_shape[-1], channels_out]],
                  axis=0,
              ),
          ),
          perm=[0, 1, 3, 2],
      )
      # conv2d_transpose does not support dilations > 1; use Keras instead.
      if any(d > 1 for d in dilations):
          keras_convt = tf_keras.layers.Conv2DTranspose(
              filters=channels_out,
              kernel_size=filter_shape,
              strides=strides,
              padding=padding,
              dilation_rate=dilations,
              use_bias=False,
          )
          _ = keras_convt(x)  # build kernel
          keras_convt.kernel = tf_kernel
          y_expected = keras_convt(x)
      else:
          y_expected = tf.nn.conv2d_transpose(
              x,
              tf_kernel,
              output_shape=output_shape,
              strides=strides_,
              padding=padding,
              dilations=dilations,
          )
  
      conv_fn = self.make_conv_fn(
          filter_shape, strides, padding, dilations
      )
      with tf.GradientTape() as tape:
          tape.watch([x, k])
          y_actual = conv_fn(x, k)
      grad = tape.gradient(y_actual, [x, k])
      self.assertAllNotNone(grad)
  
      [y_expected_, y_actual_] = self.evaluate([y_expected, y_actual])
      self.assertAllClose(y_expected_, y_actual_, rtol=1e-5, atol=0)
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.experimental.nn.util import convolution_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.internal import tf_keras
label_desc: Use image node_id 2 for calling the _BatchedConvTransposeTest obj's underlying member method code with example usage: obj.test_works_like_conv2d_transpose(input_shape, filter_shape, channels_out, strides, padding, dilations) without return types