def METHOD_NAME():
    cl_obj = contrastive.ContrastiveLoss()
    y_true = tf.constant([0, 0, 1, 1, 0, 1], dtype=tf.dtypes.int64)
    y_pred = tf.constant([0.1, 0.3, 1.3, 0.7, 1.1, 0.5], dtype=tf.dtypes.float32)
    loss = cl_obj(y_true, y_pred, sample_weight=6.0)
    # Loss = y * (y`)^2 + (1 - y) * (max(m - y`, 0))^2
    #      = [max(1 - 0.1, 0)^2, max(1 - 0.3, 0)^2,
    #         1.3^2, 0.7^2, max(1 - 1.1, 0)^2, 0.5^2]
    #      = [0.9^2, 0.7^2, 1.3^2, 0.7^2, 0^2, 0.5^2]
    #      = [0.81, 0.49, 1.69, 0.49, 0, 0.25]
    # Weighted loss = [0.81 * 6, 0.49 * 6, 1.69 * 6,
    #                  0.49 * 6, 0 * 6, 0.25 * 6]
    # Reduced loss = (0.81 + 0.49 + 1.69 + 0.49 + 0 + 0.25) * 6 / 6
    #              = 3.73
    np.testing.assert_allclose(loss, 3.73, atol=1e-6, rtol=1e-6)