code: def test_max_pool_grad(
      self,
      op_type,
      dim,
      N,
      C,
      D,
      H,
      W,
      kernel,
      stride,
      pad,
      order,
      engine,
      gc,
      dc,
  ):
      assume(pad < kernel)
      assume(dim > 1 or engine == "")
      if hiputl.run_in_hip(gc, dc):
          if dim != 2:
              assume(engine != "CUDNN")
          elif engine == "CUDNN":
              assume(order == "NCHW")
  
      if op_type.endswith("ND"):
          op_type = op_type.replace("N", str(dim))
  
      op = core.CreateOperator(
          op_type,
          ["X"],
          ["Y"],
          kernels=[kernel] * dim,
          strides=[stride] * dim,
          pads=[pad] * dim * 2,
          order=order,
          engine=engine,
      )
  
      if dim == 1:
          size = W
          dims = [N, C, W]
          axes = [0, 2, 1]
      elif dim == 2:
          size = H * W
          dims = [N, C, H, W]
          axes = [0, 2, 3, 1]
      else:
          size = D * H * W
          dims = [N, C, D, H, W]
          axes = [0, 2, 3, 4, 1]
  
      X = np.zeros((N * C, size)).astype(np.float32)
      for i in range(N * C):
          X[i, :] = np.arange(size, dtype=np.float32) / size
          np.random.shuffle(X[i, :])
      X = X.reshape(dims)
      if order == "NHWC":
          X = np.transpose(X, axes)
  
      self.assertDeviceChecks(dc, op, [X], [0])
      self.assertGradientChecks(
          gc, op, [X], 0, [0], threshold=0.05, stepsize=0.005
      )
  
imports: import numpy
  from hypothesis import assume, given, settings
  import hypothesis.strategies
  import os
  import unittest
  from caffe2.python import core, utils, workspace
  import caffe2.python.hip_test_util
  import caffe2.python.hypothesis_test_util
label_desc: Use image node_id 11 for calling the TestPooling obj's underlying member method code with example usage: obj.test_max_pool_grad(op_type, dim, N, C, D, H, W, kernel, stride, pad, order, engine, gc, dc) without return types