class_docstr: Direct tests for `_make_gradient_fn_of_y`.
class_docstr_tok: ["Direct","tests","for","`","_make_gradient_fn_of_y","`","."]
code: def test_grad_fn_of_y_grad(self):
      y = tf.convert_to_tensor([2.0, 3.0, 4.0])
      x = tf.sqrt(y)
      dy_dx_fn = sfwii._make_gradient_fn_of_y(lambda x: x**2, x)
      true_dy_dx_fn = lambda y: [2 * tf.math.pow(y, 1.0 / 2)]
  
      dy_dx, grad_dy_dx_wrt_y = gradient.value_and_gradient(dy_dx_fn, y)
      true_dy_dx, true_grad_dy_dx_wrt_y = gradient.value_and_gradient(
          true_dy_dx_fn, y
      )
      self.assertAllClose(dy_dx, true_dy_dx)
      self.assertAllClose(grad_dy_dx_wrt_y, true_grad_dy_dx_wrt_y)
  
imports: from absl.testing import parameterized
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import chain
  from tensorflow_probability.python.bijectors import power
  from tensorflow_probability.python.bijectors import scale
  from tensorflow_probability.python.bijectors import shift
  from tensorflow_probability.python.distributions import beta
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import student_t
  from tensorflow_probability.python.distributions import uniform
  from tensorflow_probability.python.experimental.bijectors import scalar_function_with_inferred_inverse
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 1 for calling the TestMakeGradientFunctionOfY obj's underlying member method code with example usage: obj.test_grad_fn_of_y_grad() without return types