code: def testGradientLogits(self):
      x = tf.Variable([-1.0, 0.0, 1])
      d = categorical.Categorical(logits=x, validate_args=True)
      with tf.GradientTape() as tape:
          loss = -d.log_prob([0, 2])
      g = tape.gradient(loss, d.trainable_variables)
      self.assertLen(g, 1)
      self.assertAllNotNone(g)
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import identity
  from tensorflow_probability.python.distributions import categorical
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
  from tensorflow_probability.python.util import deferred_tensor
label_desc: Use image node_id 1 for calling the CategoricalFromVariableTest obj's underlying member method code with example usage: obj.testGradientLogits() without return types