def tf_baseline_loss(self, states, internals, reward, update, reference=None):
if self.baseline_mode == '<STR_LIT>':<EOL><INDENT>loss = self.baseline.loss(<EOL>states=states,<EOL>internals=internals,<EOL>reward=reward,<EOL>update=update,<EOL>reference=reference<EOL>)<EOL><DEDENT>elif self.baseline_mode == '<STR_LIT>':<EOL><INDENT>loss = self.baseline.loss(<EOL>states=self.network.apply(x=states, internals=internals, update=update),<EOL>internals=internals,<EOL>reward=reward,<EOL>update=update,<EOL>reference=reference<EOL>)<EOL><DEDENT>regularization_loss = self.baseline.regularization_loss()<EOL>if regularization_loss is not None:<EOL><INDENT>loss += regularization_loss<EOL><DEDENT>return loss<EOL>
Creates the TensorFlow operations for calculating the baseline loss of a batch.

Args:
    states: Dict of state tensors.
    internals: List of prior internal state tensors.
    reward: Reward tensor.
    update: Boolean tensor indicating whether this call happens during an update.
    reference: Optional reference tensor(s), in case of a comparative loss.

Returns:
    Loss tensor.