class_docstr: Tests for policy_gradient op.
class_docstr_tok: ["Tests","for","policy_gradient","op","."]
code: def testRun(self):
      policies, actions, _ = _setup_pgops_mock(
          sequence_length=3, batch_size=2, num_policies=3
      )
      action_values = tf.constant(
          [[-0.5, 0.5], [-1.0, 0.5], [1.5, -0.5]]
      )
      loss = pg_ops.policy_gradient_loss(
          policies, actions, action_values
      )
      expected_loss = [-24.0, 3.0]
      with self.test_session() as sess:
          # Expected values are from manual calculation in a Colab.
          self.assertAllEqual(sess.run(loss), expected_loss)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  import numpy
  from six.moves import xrange
  import tensorflow.compat.v1
  import tensorflow_probability
  import tree
  from trfl import policy_gradient_ops
label_desc: Use image node_id 4 for calling the PolicyGradientLossTest obj's underlying member method code with example usage: obj.testRun() without return types