code: def image_summary(predictions, targets, hparams):
    
    del hparams
    results = tf.cast(tf.argmax(predictions, axis=-1), tf.uint8)
    gold = tf.cast(targets, tf.uint8)
    summary1 = tf.summary.image("prediction", results, max_outputs=2)
    summary2 = tf.summary.image("data", gold, max_outputs=2)
    summary = tf.summary.merge([summary1, summary2])
    return summary, tf.zeros_like(predictions)
docs: Reshapes predictions and passes it to tensorboard.
  
    Args:
      predictions : The predicted image (logits).
      targets : The ground truth.
      hparams: model hparams.
  
    Returns:
      summary_proto: containing the summary images.
      weights: A Tensor of zeros of the same shape as predictions.