def testGradQtm1(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 propogated during gradient _descent_, rather than _ascent_.
      gradients = tf.gradients([-self.loss_op], [self.q_tm1])
      grad_q_tm1 = sess.run(gradients[0])
      self.assertAllClose(grad_q_tm1, [[0, 0, 0], [0, 3, 0]])
Tests that the gradients of negative loss are equal to the td_error.
trfl/action_value_ops_test.py