code: def testGradient2D(self):
      with self.session(use_gpu=test.is_gpu_available()):
          for padding in ["SAME", "VALID"]:
              for pooling_type in ["AVG", "MAX"]:
                  for input_shape in [[2, 4, 5, 2], [1, 5, 4, 1]]:
                      for window_shape in [[1, 1], [2, 1], [2, 2]]:
                          if padding != "SAME":
                              for dilation_rate in [
                                  [1, 1],
                                  [2, 1],
                                  [2, 2],
                              ]:
                                  self._test_gradient(
                                      input_shape=input_shape,
                                      window_shape=window_shape,
                                      padding=padding,
                                      pooling_type=pooling_type,
                                      dilation_rate=dilation_rate,
                                      strides=[1, 1],
                                  )
                          for strides in [
                              [1, 1],
                              [2, 1],
                              [1, 2],
                              [2, 2],
                          ]:
                              if np.any(
                                  np.array(strides) > window_shape
                              ):
                                  continue
                              self._test(
                                  input_shape=input_shape,
                                  window_shape=window_shape,
                                  padding=padding,
                                  pooling_type=pooling_type,
                                  dilation_rate=[1, 1],
                                  strides=strides,
                              )
  
imports: import math
  import numpy
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import gradient_checker
  from tensorflow.python.ops import nn_ops
  import tensorflow.python.ops.nn_grad
  from tensorflow.python.platform import test
label_desc: Use image node_id 9 for calling the PoolingTest obj's underlying member method code with example usage: obj.testGradient2D() without return types