code: def _testBatchNormGradGrad(self, config):
      shape = config["shape"]
      err_tolerance = config["err_tolerance"]
      dtype = config["dtype"]
      rank = len(shape)
      if rank == 4:
          data_format_nhwc, features_nhwc = "NHWC", shape[3]
          data_format_nchw, features_nchw = "NCHW", shape[1]
      else:
          data_format_nhwc, features_nhwc = "NDHWC", shape[4]
          data_format_nchw, features_nchw = "NCDHW", shape[1]
      for is_training in [True, False]:
          if test.is_gpu_available():
              self._test_grad_grad(
                  shape,
                  dtype,
                  [features_nhwc],
                  np.float32,
                  use_gpu=True,
                  data_format=data_format_nhwc,
                  is_training=is_training,
                  err_tolerance=err_tolerance,
              )
              self._test_grad_grad(
                  shape,
                  dtype,
                  [features_nchw],
                  np.float32,
                  use_gpu=True,
                  data_format=data_format_nchw,
                  is_training=is_training,
                  err_tolerance=err_tolerance,
              )
          self._test_grad_grad(
              shape,
              dtype,
              [features_nhwc],
              np.float32,
              use_gpu=False,
              data_format=data_format_nhwc,
              is_training=is_training,
              err_tolerance=err_tolerance,
          )
          self._test_grad_grad(
              shape,
              dtype,
              [features_nchw],
              np.float32,
              use_gpu=False,
              data_format=data_format_nchw,
              is_training=is_training,
              err_tolerance=err_tolerance,
          )
  
imports: 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 errors_impl
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_nn_ops
  from tensorflow.python.ops import gradient_checker
  from tensorflow.python.ops import gradients_impl
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import nn_fused_batch_norm_grad
  from tensorflow.python.ops import nn_impl
  from tensorflow.python.ops import nn_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 39 for calling the BatchNormalizationTest obj's underlying member method code with example usage: obj._testBatchNormGradGrad(config) without return types