class_docstr: Gradient-checking for ExtractImagePatches op.
class_docstr_tok: ["Gradient-checking","for","ExtractImagePatches","op","."]
code: def testJitCompile(self):
      with test_util.AbstractGradientTape(use_tape=True) as tape:
          shape = (4, 512, 512, 1)
          ksize = 5
  
          images = variables.Variable(
              np.random.uniform(size=shape), name="inputs"
          )
          tape.watch(images)
  
          # Github issues: #59058, #59061
          # tf.image.extract_image_patches() does not support backward pass
          # when compiled with XLA.
          extract_image_patches_jit = polymorphic_function.function(
              array_ops.extract_image_patches, jit_compile=True
          )
          patches = extract_image_patches_jit(
              images,
              ksizes=[1, ksize, ksize, 1],
              strides=[1] * 4,
              rates=[1] * 4,
              padding="SAME",
          )
  
          gradients = tape.gradient(patches, images)
          self.assertIsNotNone(gradients)
  
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.eager import context
  from tensorflow.python.eager.polymorphic_function import polymorphic_function
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import random_seed
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gradient_checker
  from tensorflow.python.ops import gradient_checker_v2
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
label_desc: Use image node_id 8 for calling the ExtractImagePatchesGradTest obj's underlying member method code with example usage: obj.testJitCompile() without return types