class_docstr: Gradient-checking for ExtractVolumePatches op.
code: def testGradient(self, in_shape, ksizes, strides):
      if test_util.is_gpu_available():
          self.skipTest("b/171837334: skip gpu test.")
  
      # Set graph seed for determinism.
      random_seed = 42
      random_seed_lib.set_random_seed(random_seed)
  
      with self.cached_session():
          np.random.seed(random_seed)
          input_val = constant_op.constant(
              np.random.random(in_shape), dtype=dtypes.float32
          )
  
          for padding in ["VALID", "SAME"]:
  
              def extract(
                  in_val,
                  ksizes=ksizes,
                  strides=strides,
                  padding=padding,
              ):
                  return array_ops.extract_volume_patches(
                      in_val, ksizes, strides, padding
                  )
  
              rtn = gradient_checker_v2.compute_gradient(
                  extract, [input_val]
              )
              err = gradient_checker_v2.max_error(*rtn)
  
              print("extract_volume_patches gradient err: %.4e" % err)
              self.assertLess(err, 1e-4)
  
file_path: tensorflow-upstream/tensorflow/python/kernel_tests/image_ops/extract_volume_patches_grad_test.py
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.eager import context
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  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_v2
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling the ExtractVolumePatchesGradTest obj's underlying member method code with example usage: obj.testGradient(in_shape, ksizes, strides) and returns: array_ops