code: def autograd_assert(*args, **kwargs):
      func = kwargs["func"]
      grad_f = kwargs["grad_func"]
      argnum = kwargs["argnum"] if "argnum" in kwargs else None
  
      grad_func = grad_and_loss(func, argnum)
      grad_vals, output = grad_func(*args)
      res = func(*args)
      assert same(output.asnumpy(), res.asnumpy())
      grad_res = grad_f(*args)
      assert len(grad_vals) == len(grad_res)
      for a, b in zip(grad_vals, grad_res):
          assert same(a.asnumpy(), b.asnumpy())
  
imports: import functools
  import mxnet.ndarray
  from mxnet.ndarray import zeros_like
  from mxnet.autograd import *
  from mxnet.test_utils import *
  from common import xfail_when_nonstandard_decimal_separator
  from mxnet.test_utils import environment
  import pytest
label_desc: Use image node_id 3 for calling a global function with example usage: autograd_assert() without return types