class_docstr: Tests for DpgLearning.
    
class_docstr_tok: ["Tests","for","DpgLearning","."]
docstr: Gradient of loss w.r.t. actor network parameter w_s is correct.
docstr_tok: ["Gradient","of","loss","w.r.t",".","actor","network","parameter","w_s","is","correct","."]
code: def testDpgGradient(self):
      """Gradient of loss w.r.t. actor network parameter w_s is correct."""
      with self.test_session() as sess:
          weight_gradient = tf.gradients(self.loss, self.w_s)
          sess.run(tf.global_variables_initializer())
          value_dpg_gradient, value_s_tm1, value_w = sess.run(
              [weight_gradient[0], self.s_tm1, self.w]
          )
          true_grad = self.calculateTrueGradient(value_w, value_s_tm1)
          self.assertAllClose(value_dpg_gradient, true_grad)
  
file_path: trfl/trfl/dpg_ops_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import tensorflow.compat.v1
  from trfl import dpg_ops
label_desc: Use image node_id 4 for calling the DpgTest obj's underlying member method code with example usage: obj.testDpgGradient() without return types