class_docstr: Tests for discrete_policy_gradient_loss op.
class_docstr_tok: ["Tests","for","discrete_policy_gradient_loss","op","."]
code: def testLoss(self, is_multi_actions):
      self._setUpLoss(is_multi_actions)
      with self.test_session() as sess:
          self.assertEqual(
              self._loss.get_shape(), tf.TensorShape(2)
          )  # [B]
          self.assertAllClose(
              sess.run(self._loss),
              # computed by summing expected losses from DiscretePolicyGradientTest
              # over the two sequences of length two which I've split the batch
              # into:
              self._num_action_components
              * np.array([1.386294, 1.313262]),
          )
  
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 tree
  from trfl import discrete_policy_gradient_ops
label_desc: Use image node_id 2 for calling the DiscretePolicyGradientLossTest obj's underlying member method code with example usage: obj.testLoss(is_multi_actions) without return types