def METHOD_NAME(self, n, gc, dc):
    X = np.random.rand(n).astype(np.float32)
    def avg_op(X):
        return [np.mean(X)]
    op = core.CreateOperator(
        "SumElements",
        ["X"],
        ["y"],
        average=1
    )
    self.assertReferenceChecks(
        device_option=gc,
        op=op,
        inputs=[X],
        reference=avg_op,
    )
    self.assertGradientChecks(
        device_option=gc,
        op=op,
        inputs=[X],
        outputs_to_check=0,
        outputs_with_grads=[0],
    )