code: def test_grad(self):
      T = theano.tensor
      a = np.asarray(self.rng.randn(5, 5), dtype=config.floatX)
  
      x = T.matrix("x")
  
      expressions_gradients = [
          (x * gradient.disconnected_grad(x), x),
          (x * gradient.disconnected_grad(T.exp(x)), T.exp(x)),
          (x**2 * gradient.disconnected_grad(x), 2 * x**2),
      ]
  
      for expr, expr_grad in expressions_gradients:
          g = gradient.grad(expr.sum(), x)
          # gradient according to theano
          f = theano.function([x], g, on_unused_input="ignore")
          # desired gradient
          f2 = theano.function([x], expr_grad, on_unused_input="ignore")
  
          assert np.allclose(f(a), f2(a))
  
imports: from __future__ import absolute_import, print_function, division
  from collections import OrderedDict
  import unittest
  import numpy
  from six.moves import xrange
  import theano
  from theano import gof, change_flags
  from theano.compat import izip
  from theano.tests import unittest_tools
  from theano import gradient
  from theano import config
  from theano.gof.null_type import NullType
  from theano.sandbox.rng_mrg import MRG_RandomStreams
label_desc: Use image node_id 3 for calling the TestDisconnectedGrad obj's underlying member method code with example usage: obj.test_grad() without return types