code: def test004_hessian():
      x = tensor.vector()
      y = tensor.sum(x**2)
      Hx = tensor.hessian(y, x)
      f = theano.function([x], Hx)
      vx = np.arange(10).astype(theano.config.floatX)
      assert np.allclose(f(vx), np.eye(10) * 2)
  
file_path: Theano/theano/tests/test_2nd_order_grads.py
imports: from __future__ import absolute_import, print_function, division
  from six.moves import xrange
  from theano.tests import unittest_tools
  import theano
  from theano import tensor
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: test004_hessian() without return types