code: def _test_grad(input_shape, output_shape=None):
      image_size = tf.math.cumprod(input_shape)[-1]
      image_size = tf.cast(image_size, tf.float32)
      test_image = tf.reshape(
          tf.range(0, image_size, dtype=tf.float32), input_shape
      )
      # Scale test image to range [0, 0.01]
      test_image = (test_image / image_size) * 0.01
  
      def transform_fn(x):
          x.set_shape(input_shape)
          transform = transform_ops.angles_to_projective_transforms(
              np.pi / 2, 4, 4
          )
          return transform_ops.transform(
              images=x, transforms=transform, output_shape=output_shape
          )
  
      theoretical, numerical = tf.test.compute_gradient(
          transform_fn, [test_image]
      )
  
      np.testing.assert_almost_equal(
          theoretical[0], numerical[0], decimal=6
      )
  
imports: import pytest
  import numpy
  import tensorflow
  from skimage import transform
  from tensorflow_addons.image import transform_ops
  from tensorflow_addons.utils import test_utils
label_desc: Use image node_id 9 for calling a global function with example usage: _test_grad(input_shape, output_shape) and returns: transform_ops