code: def _checkGrad(self, x, block_size, data_format):
      # NCHW is implemented for only GPU.
      if data_format == "NCHW" and not test.is_gpu_available():
          return
  
      assert 4 == x.ndim
      with self.cached_session():
          tf_x = ops.convert_to_tensor(x)
          tf_y = array_ops.depth_to_space(
              tf_x, block_size, data_format=data_format
          )
  
          epsilon = 1e-2
          ((x_jacob_t, x_jacob_n)) = gradient_checker.compute_gradient(
              tf_x,
              x.shape,
              tf_y,
              tf_y.get_shape().as_list(),
              x_init_value=x,
              delta=epsilon,
          )
          self.assertAllClose(
              x_jacob_t, x_jacob_n, rtol=1e-2, atol=epsilon
          )
  
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.client import device_lib
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors_impl
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_array_ops
  from tensorflow.python.ops import gradient_checker
  from tensorflow.python.ops import math_ops
  from tensorflow.python.platform import test
  from tensorflow.python.platform import tf_logging
label_desc: Use image node_id 1 for calling the DepthToSpaceGradientTest obj's underlying member method code with example usage: obj._checkGrad(x, block_size, data_format) without return types