def testDpgGradientNormClipping(self):
    """Tests the gradient qd/qa are clipped using norm clipping."""
    _, dpg_extra = dpg_ops.dpg(
        self.q_tm1_max, self.a_tm1_max, dqda_clipping=0.01, clip_norm=True)
    with self.test_session() as sess:
      sess.run(tf.global_variables_initializer())
      for i in range(int(self.batch_size)):
        self.assertAllClose(np.linalg.norm(dpg_extra.dqda.eval()[i]), 0.01)
Tests the gradient qd/qa are clipped using norm clipping.
trfl/dpg_ops_test.py