docs: def _value_loss(self, observ, reward, length):
      """Compute the loss function for the value baseline.
  
      The value loss is the difference between empirical and approximated returns
      over the collected episodes. Returns the loss tensor and a summary strin.
  
      Args:
        observ: Sequences of observations.
        reward: Sequences of reward.
        length: Batch of sequence lengths.
  
      Returns:
        Tuple of loss tensor and summary tensor.
      """
      with tf.name_scope('value_loss'):
        value = self._network(observ, length).value
        return_ = utility.discounted_return(
            reward, length, self._config.discount)
        advantage = return_ - value
        value_loss = 0.5 * self._mask(advantage ** 2, length)
        summary = tf.summary.merge([
            tf.summary.histogram('value_loss', value_loss),
            tf.summary.scalar('avg_value_loss', tf.reduce_mean(value_loss))])
        value_loss = tf.reduce_mean(value_loss)
        return tf.check_numerics(value_loss, 'value_loss'), summary