code: def setUp(self):
      super(SequenceAdvantageActorCriticLossGradientTest, self).setUp()
      self.num_actions = 3
      self.num_action_components = 5
      policy_logits_np = np.array(
          [[[0.0, 0.0, 1.0]], [[0.0, 1.0, 0.0]]]
      )
      self.policy_logits = tf.constant(
          policy_logits_np, dtype=tf.float32
      )
      self.multi_policy_logits = [
          tf.constant(policy_logits_np, dtype=tf.float32)
          for _ in xrange(self.num_action_components)
      ]
      self.baseline_values = tf.constant([[0.2], [0.3]])
      actions_np = np.array([[0], [1]])
      actions = tf.constant(actions_np)
      multi_actions = [
          tf.constant(actions_np)
          for _ in xrange(self.num_action_components)
      ]
      rewards = tf.constant([[0.4], [0.5]])
      pcontinues = tf.constant([[0.9], [0.8]])
      bootstrap_value = tf.constant([0.1])
      baseline_cost = 0.15
      entropy_cost = 0.25
  
      self.op = pg_ops.sequence_advantage_actor_critic_loss(
          self.policy_logits,
          self.baseline_values,
          actions,
          rewards,
          pcontinues,
          bootstrap_value,
          baseline_cost=baseline_cost,
          entropy_cost=entropy_cost,
      )
  
      self.multi_op = pg_ops.sequence_advantage_actor_critic_loss(
          self.multi_policy_logits,
          self.baseline_values,
          multi_actions,
          rewards,
          pcontinues,
          bootstrap_value,
          baseline_cost=baseline_cost,
          entropy_cost=entropy_cost,
      )
  
      self.invalid_grad_inputs = [
          actions,
          rewards,
          pcontinues,
          bootstrap_value,
      ]
      self.invalid_grad_outputs = [None] * len(self.invalid_grad_inputs)
  
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 SequenceAdvantageActorCriticLossGradientTest obj's underlying member method code with example usage: obj.setUp() without return types