code: def grad_variant_input_test(
      self, grad_op_name, X, ref, num_reduce_dim
  ):
      workspace.ResetWorkspace()
  
      Y = np.array(ref(X)[0]).astype(np.float32)
      dY = np.array(np.random.rand(*Y.shape)).astype(np.float32)
      shape = np.array(X.shape).astype(np.int64)
  
      workspace.FeedBlob("X", X)
      workspace.FeedBlob("dY", dY)
      workspace.FeedBlob("shape", shape)
  
      grad_op = core.CreateOperator(
          grad_op_name,
          ["dY", "X"],
          ["dX"],
          num_reduce_dim=num_reduce_dim,
      )
  
      grad_op1 = core.CreateOperator(
          grad_op_name,
          ["dY", "shape"],
          ["dX1"],
          num_reduce_dim=num_reduce_dim,
      )
  
      workspace.RunOperatorOnce(grad_op)
      workspace.RunOperatorOnce(grad_op1)
  
      dX = workspace.FetchBlob("dX")
      dX1 = workspace.FetchBlob("dX1")
      np.testing.assert_array_equal(dX, dX1)
  
imports: from caffe2.python import core, workspace
  from hypothesis import given, settings
  import caffe2.python.hypothesis_test_util
  import caffe2.python.serialized_test.serialized_test_util
  import hypothesis.strategies
  import numpy
  import itertools
label_desc: Use image node_id 1 for calling the TestReduceFrontReductions obj's underlying member method code with example usage: obj.grad_variant_input_test(grad_op_name, X, ref, num_reduce_dim) without return types