code: def testAvgPool(self):
      # Wrapper around AvgPoolGrad that ignores extra arguments needed by
      # MaxPoolGrad.
      def AvgPoolGrad(
          inputs,
          outputs,
          output_gradients,
          ksize,
          strides,
          padding,
          data_format,
      ):
          del outputs  # Unused by average-pooling gradients.
          return gen_nn_ops.avg_pool_grad(
              inputs.get_shape().as_list(),
              output_gradients,
              ksize=ksize,
              strides=strides,
              padding=padding,
              data_format=data_format,
          )
  
      self._TestPooling(nn_ops.avg_pool, AvgPoolGrad)
  
imports: import numpy
  from tensorflow.compiler.tests import xla_test
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  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 nn_ops
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 5 for calling the PoolGradTest obj's underlying member method code with example usage: obj.testAvgPool() and returns: gen_nn_ops