code: def testGradQtm1(self):
      with self.test_session() as sess:
          # Take gradients of the negative loss, so that the tests here check the
          # values propagated during gradient _descent_, rather than _ascent_.
          gradients = tf.gradients(
              [-self.qlearning.loss], [self.logits_q_tm1]
          )
          grad_q_tm1 = sess.run(gradients[0])
          # Correct gradient directions (including 0.0 for unused actions at t=tm1).
          expected = np.zeros_like(grad_q_tm1)
          expected[0, 2] = [-1, -1, 1]
          expected[1, 1] = [-1, 1, -1]
          expected[2, 3] = [-1, -1, 1]
          expected[3, 0] = [-1, 1, -1]
          expected[4, 1] = [-1, 1, -1]
          self.assertAllClose(np.sign(grad_q_tm1), expected)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import tensorflow.compat.v1
  from trfl import dist_value_ops
label_desc: Use image node_id 6 for calling the CategoricalDistQLearningTest obj's underlying member method code with example usage: obj.testGradQtm1() without return types