code: def test_output_gradients(self):
      jacobian = np.float32(
          [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0], [7.0, 8.0, 9.0]]
      )
      f = lambda x: tf.squeeze(tf.matmul(jacobian, x[:, tf.newaxis]))
      x = np.ones([3], dtype=np.float32)
      output_gradients = np.float32([1.0, 2.0, 3.0])
      y, dydx = self.evaluate(
          gradient.value_and_gradient(
              f, x, output_gradients=output_gradients
          )
      )
      self.assertAllClose(f(x), y, atol=1e-6, rtol=1e-6)
      self.assertAllClose(
          np.dot(output_gradients, jacobian), dydx, atol=1e-6, rtol=1e-6
      )
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
  from tensorflow_probability.python.math.gradient import batch_jacobian
  from tensorflow_probability.python.math.gradient import value_and_gradient_with_auto_expansion
label_desc: Use image node_id 11 for calling the GradientTest obj's underlying member method code with example usage: obj.test_output_gradients() without return types