code: def test_jacobian_disconnected_inputs():
      # Test that disconnected inputs are properly handled by jacobian.
  
      v1 = tensor.vector()
      v2 = tensor.vector()
      jacobian_v = theano.gradient.jacobian(
          1 + v1, v2, disconnected_inputs="ignore"
      )
      func_v = theano.function([v1, v2], jacobian_v)
      val = np.arange(4.0).astype(theano.config.floatX)
      assert np.allclose(func_v(val, val), np.zeros((4, 4)))
  
      s1 = tensor.scalar()
      s2 = tensor.scalar()
      jacobian_s = theano.gradient.jacobian(
          1 + s1, s2, disconnected_inputs="ignore"
      )
      func_s = theano.function([s2], jacobian_s)
      val = np.array(1.0).astype(theano.config.floatX)
      assert np.allclose(func_s(val), np.zeros(1))
  
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 5 for calling a global function with example usage: test_jacobian_disconnected_inputs() without return types