code: def test_const_graph():
      L = []
  
      def foo(x, y):
          L.append(None)
          return grad(lambda x: np.sin(x) + x * 2)(x * y)
  
      foo_wrapped = const_graph(foo)
  
      assert len(L) == 0
      assert scalar_close(foo(0.0, 0.0), foo_wrapped(0.0, 0.0))
      assert len(L) == 2
      assert scalar_close(foo(1.0, 0.5), foo_wrapped(1.0, 0.5))
      assert len(L) == 3
      assert scalar_close(foo(1.0, 0.5), foo_wrapped(1.0, 0.5))
      assert len(L) == 4
  
file_path: autograd/tests/test_misc.py
imports: import autograd.numpy
  import autograd.numpy.random
  from autograd.test_util import scalar_close
  from autograd import make_vjp, grad
  from autograd.tracer import primitive
  from autograd.misc import const_graph, flatten
label_desc: Use image node_id 1 for calling a global function with example usage: test_const_graph() and returns: grad