code: def testNonVariableGradients(self):
      map_values = tf.convert_to_tensor([0.3, 0.5])
  
      def _func(map_values):
          b = categorical_to_discrete.CategoricalToDiscrete(
              map_values=map_values, validate_args=True
          )
          return tf.reduce_sum(b.forward([0, 1]))
  
      grads = gradient.value_and_gradient(_func, [map_values])
      self.assertAllNotNone(grads)
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector_test_util
  from tensorflow_probability.python.bijectors import categorical_to_discrete
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 12 for calling the CategoricalToDiscreteTest obj's underlying member method code with example usage: obj.testNonVariableGradients() and returns: tf