code: def test_pooling(backend_cpu64, poolargs):
      nin, nifm, fshape, batch_size, op = poolargs
      NervanaObject.be.bsz = NervanaObject.be.batch_size = batch_size
      sz = nin * nin * nifm * batch_size
      epsilon = 1.0e-5
      # make sure perturnationc an never change the max element
      inp = np.arange(sz) * 2.5 * epsilon
      # shuffle
      np.random.shuffle(inp)
      inp = inp.reshape((nin * nin * nifm, batch_size))
  
      lshape = (nifm, nin, nin)
      layer = PoolingWithReset(fshape, op=op)
  
      pert_frac = 0.1  # test 10% of the inputs
      # select pert_frac fraction of inps to perturb
      pert_cnt = int(np.ceil(inp.size * pert_frac))
      pert_inds = np.random.permutation(inp.size)[0:pert_cnt]
  
      (max_abs, max_rel) = general_gradient_comp(
          layer,
          inp,
          epsilon=epsilon,
          lshape=lshape,
          pert_inds=pert_inds,
          pooling=True,
      )
      assert max_abs < 1.0e-7
  
file_path: neon/tests/test_gradient_pool.py
imports: import itertools
  import numpy
  import pytest
  from neon import NervanaObject
  from neon.layers.layer import Pooling
  from grad_funcs import general_gradient_comp
label_desc: Use image node_id 2 for calling a global function with example usage: test_pooling(backend_cpu64, poolargs) without return types