class_docstr: Tests for discrete_policy_gradient_loss op.
class_docstr_tok: ["Tests","for","discrete_policy_gradient_loss","op","."]
code: def _setUpLoss(self, is_multi_actions):
      policy_logits_np = np.array(
          [[[0, 1], [0, 1]], [[1, 1], [0, 100]]]
      )
      actions_np = np.array([[0, 0], [1, 1]], dtype=np.int32)
  
      if is_multi_actions:
          self._num_action_components = 3
          self._policy_logits_nest = [
              tf.constant(policy_logits_np, dtype=tf.float32)
              for _ in xrange(self._num_action_components)
          ]
          self._actions_nest = [
              tf.constant(actions_np, dtype=tf.int32)
              for _ in xrange(self._num_action_components)
          ]
      else:
          self._num_action_components = 1
          self._policy_logits_nest = tf.constant(
              policy_logits_np, dtype=tf.float32
          )
          self._actions_nest = tf.constant(actions_np, dtype=tf.int32)
  
      self._action_values = tf.constant(
          [[0, 1], [2, 1]], dtype=tf.float32
      )
  
      self._loss = pg_ops.discrete_policy_gradient_loss(
          self._policy_logits_nest,
          self._actions_nest,
          self._action_values,
      )
  
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 1 for calling the DiscretePolicyGradientLossTest obj's underlying member method code with example usage: obj._setUpLoss(is_multi_actions) without return types