code: def test_grad(self):
      input1_value = np.arange(9).reshape(3, 3).astype("float32")
      input2_value = 10.0
  
      grads = [
          grad(self.monitored_input1.sum(), self.input1),
          grad(self.monitored_input2.sum(), self.input2),
      ]
  
      # Add self.monitored_input1 as an output to the PyTensor function to
      # prevent PyTensor from optimizing the PdbBreakpoint op out of the
      # function graph
      fct = 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: pytensor/tests/test_breakpoint.py
imports: import numpy
  from pytensor.breakpoint import PdbBreakpoint
  from pytensor.compile.function import function
  from pytensor.gradient import grad
  from pytensor.tensor.math import dot, gt
  from pytensor.tensor.type import fmatrix, fscalar
  from tests import unittest_tools
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