code: def test_undefined_grad_grad(self):
      # tests that undefined grads are caught in the grad method
  
      class DummyOp(gof.Op):
          __props__ = ()
  
          def make_node(self, x):
              return gof.Apply(self, [x], [x.type()])
  
          def grad(self, inputs, output_grads):
              return [
                  theano.gradient.grad_undefined(self, 0, inputs[0])
              ]
  
      a = theano.tensor.scalar()
      b = DummyOp()(a)
  
      self.assertRaises(TypeError, theano.gradient.grad, b, 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 4 for calling the test_grad obj's underlying member method code with example usage: obj.test_undefined_grad_grad() and returns: gof, list