class_docstr: Tests for DpgLearning.
    
class_docstr_tok: ["Tests","for","DpgLearning","."]
docstr: Tests the gradient qd/qa are clipped.
docstr_tok: ["Tests","the","gradient","qd\/qa","are","clipped","."]
code: def testDpgGradientClipping(self):
      """Tests the gradient qd/qa are clipped."""
      _, dpg_extra = dpg_ops.dpg(
          self.q_tm1_max, self.a_tm1_max, dqda_clipping=0.01
      )
      with self.test_session() as sess:
          sess.run(tf.global_variables_initializer())
          value_grad = np.transpose(self.w.eval())[0]
          for i in range(int(self.batch_size)):
              self.assertAllClose(
                  dpg_extra.dqda.eval()[i],
                  np.clip(value_grad, -0.01, 0.01),
              )
              self.assertTrue(
                  np.greater(np.absolute(value_grad), 0.01).any()
              )
  
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 7 for calling the DpgTest obj's underlying member method code with example usage: obj.testDpgGradientClipping() without return types