code: def _getJacobians(
      self,
      pool_func,
      input_sizes,
      output_sizes,
      window,
      strides,
      padding,
      data_format,
      use_gpu,
      dtype=np.float32,
  ):
      with self.cached_session(use_gpu=use_gpu):
          x = (
              np.arange(np.prod(input_sizes))
              .reshape(input_sizes)
              .astype(dtype)
          )
          input_tensor = constant_op.constant(x, shape=input_sizes)
          ksize = [1, window[0], window[1], window[2], 1]
          strides = [1, strides[0], strides[1], strides[2], 1]
          if data_format == "NCDHW":
              ksize = test_util.NHWCToNCHW(ksize)
              strides = test_util.NHWCToNCHW(strides)
              input_tensor = test_util.NHWCToNCHW(input_tensor)
              output_sizes = test_util.NHWCToNCHW(output_sizes)
  
          def func(in_tensor):
              return pool_func(
                  in_tensor,
                  ksize=ksize,
                  strides=strides,
                  padding=padding,
                  data_format=data_format,
              )
  
          (
              input_jacob_a,
              input_jacob_n,
          ) = gradient_checker_v2.compute_gradient(func, [input_tensor])
  
          def pool_grad_function(upstream_gradients):
              with backprop.GradientTape() as tape:
                  tape.watch(input_tensor)
                  pool_output = pool_func(
                      input_tensor,
                      ksize=ksize,
                      strides=strides,
                      padding=padding,
                      data_format=data_format,
                  )
                  gradient_injector_output = (
                      pool_output * upstream_gradients
                  )
                  return tape.gradient(
                      gradient_injector_output, input_tensor
                  )
  
          upstream_tensor = constant_op.constant(
              2 * np.random.rand(*output_sizes) - 1, dtype=dtype
          )
          (
              grad_jacob_a,
              grad_jacob_n,
          ) = gradient_checker_v2.compute_gradient(
              pool_grad_function, [upstream_tensor]
          )
  
          return (
              (input_jacob_a, grad_jacob_a),
              (input_jacob_n, grad_jacob_n),
          )
  
imports: import numpy
  from tensorflow.python.eager import backprop
  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
  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_v2
  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 15 for calling the PoolingTest obj's underlying member method code with example usage: obj._getJacobians(pool_func, input_sizes, output_sizes, window, strides, padding, data_format, use_gpu, dtype) and returns: input_jacob_a,  grad_jacob_a,  input_jacob_n,  grad_jacob_n, pool_func, tape