def discriminator_loss_phase(
    global_batch_size,
    discriminator,
    real_images,
    fake_logits,
    params,
    global_step,
    summary_file_writer,
    mode,
    training
):
    """Gets real logits and loss for discriminator.

    Args:
        global_batch_size: int, global batch size for distribution.
        discriminator: instance of `Discriminator`.
        real_images: tensor, real images of shape
            [batch_size, height * width * depth].
        fake_logits: tensor, discriminator logits of fake images of shape
            [batch_size, 1].
        params: dict, user passed parameters.
        global_step: int, current global step for training.
        summary_file_writer: summary file writer.
        training: bool, if in training mode.

    Returns:
        Real logits and discriminator loss.
    """
    # Get real logits from discriminator using real image.
    real_logits = discriminator.get_model()(
        inputs=real_images, training=training
    )

    # Get discriminator total loss.
    discriminator_total_loss = discriminator.get_discriminator_loss(
        global_batch_size=global_batch_size,
        fake_logits=fake_logits,
        real_logits=real_logits,
        params=params,
        global_step=global_step,
        summary_file_writer=summary_file_writer
    )

    return real_logits, discriminator_total_loss