code: def test_grad(self):
      input1_value = np.arange(9).reshape(3, 3).astype("float32")
      input2_value = 10.0
  
      grads = [
          T.grad(self.monitored_input1.sum(), self.input1),
          T.grad(self.monitored_input2.sum(), self.input2),
      ]
  
      # Add self.monitored_input1 as an output to the Theano function to
      # prevent Theano from optimizing the PdbBreakpoint op out of the
      # function graph
      fct = theano.function(
          [self.input1, self.input2], grads + [self.monitored_input1]
      )
  
      gradients = fct(input1_value, input2_value)[:-1]
  
      expected_gradients = [
          np.ones((3, 3), dtype="float32"),
          np.array(1.0, dtype="float32"),
      ]
  
      for i in range(len(gradients)):
          np.testing.assert_allclose(
              gradients[i], expected_gradients[i]
          )
  
file_path: Theano/theano/tests/test_breakpoint.py
imports: from __future__ import absolute_import, print_function, division
  import numpy
  import theano
  import theano.tensor
  from theano.tests import unittest_tools
  from theano.tests.breakpoint import PdbBreakpoint
label_desc: Use image node_id 3 for calling the TestPdbBreakpoint obj's underlying member method code with example usage: obj.test_grad() without return types