import tensorflow as tf

    return avg_loss


def compute_contra_loss(pred1, pred2, tgt1, tgt2, hard_ratio=1.0):
    geq = tf.cast((tgt1 - tgt2) > 0, tf.bool)
    tgt_larg = tf.where(geq, tgt1, tgt2)
    tgt_small = tf.where(geq, tgt2, tgt1)
    pred_larg = tf.where(geq, pred1, pred2)
