class_docstr: Tests for ValueLearning.
docstr: Tests that the gradients of negative loss are equal to the td_error.
code: def testGradVtm1(self):
      """Tests that the gradients of negative loss are equal to the td_error."""
      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.value_learning.loss], [self.v_tm1]
          )
          grad_v_tm1 = sess.run(gradients[0])
          self.assertAllClose(
              grad_v_tm1, [-2, -2, -2, -2, -1.5, -1, -2, -1, 0]
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  import tensorflow.compat.v1
  import tree
  from trfl import value_ops
label_desc: Use image node_id 7 for calling the TDLearningTest obj's underlying member method code with example usage: obj.testGradVtm1() without return types