parameters: (self, policy_logits, action_values)
return_statement: return total_loss
docstring: Constructs a TF graph that computes the RPG loss for batches.
  
      Args:
        policy_logits: `B x A` tensor corresponding to policy logits.
        action_values: `B x A` tensor corresponding to Q-values.
  
      Returns:
        loss: A 0-D `float` tensor corresponding the loss.
docstring_summary: Constructs a TF graph that computes the RPG loss for batches.
docstring_tokens: Constructs a TF graph that computes the RPG loss for batches .
function: def loss(self, policy_logits, action_values):
      """Constructs a TF graph that computes the RPG loss for batches.
  
      Args:
        policy_logits: `B x A` tensor corresponding to policy logits.
        action_values: `B x A` tensor corresponding to Q-values.
  
      Returns:
        loss: A 0-D `float` tensor corresponding the loss.
      """
      _assert_rank_and_shape_compatibility([policy_logits, action_values], 2)
      regrets = compute_regrets(policy_logits, action_values)
      _assert_rank_and_shape_compatibility([regrets], 1)
      total_regret = tf.reduce_mean(regrets, axis=0)
  
      total_loss = total_regret
      if self._entropy_cost:
        policy_entropy = tf.reduce_mean(compute_entropy(policy_logits))
        entropy_loss = tf.multiply(
            float(self._entropy_cost), policy_entropy, name="entropy_loss")
        total_loss = tf.add(
            total_loss, entropy_loss, name="total_loss_with_entropy")
  
      return total_loss
function_tokens: def loss ( self , policy_logits , action_values ) : _assert_rank_and_shape_compatibility ( [ policy_logits , action_values ] , 2 ) regrets = compute_regrets ( policy_logits , action_values ) _assert_rank_and_shape_compatibility ( [ regrets ] , 1 ) total_regret = tf . reduce_mean ( regrets , axis = 0 ) total_loss = total_regret if self . _entropy_cost : policy_entropy = tf . reduce_mean ( compute_entropy ( policy_logits ) ) entropy_loss = tf . multiply ( float ( self . _entropy_cost ) , policy_entropy , name = "entropy_loss" ) total_loss = tf . add ( total_loss , entropy_loss , name = "total_loss_with_entropy" ) return total_loss