def lexicographic_comparator_old(*tf_args: TfVal) -> TfVal:
    assert (len(tf_args) == (2 * len(operands)))
    inside_comparison = None
    for key_idx in range((num_keys - 1), (- 1), (- 1)):
        a = tf_args[(2 * key_idx)]
        b = tf_args[((2 * key_idx) + 1)]
        a_lt_b = tf.math.less(a, b)
        if (inside_comparison is None):
            inside_comparison = a_lt_b
        else:
            inside_comparison = tf.math.logical_or(a_lt_b, tf.math.logical_and(tf.math.equal(a, b), inside_comparison))
    return inside_comparison
def lexicographic_comparator_old(*tf_args: TfVal) -> TfVal:
    assert (len(tf_args) == (2 * len(operands)))
    inside_comparison = None
    for key_idx in range((num_keys - 1), (- 1), (- 1)):
        a = tf_args[(2 * key_idx)]
        b = tf_args[((2 * key_idx) + 1)]
        a_lt_b = tf.math.less(a, b)
        if (inside_comparison is None):
            inside_comparison = a_lt_b
        else:
            inside_comparison = tf.math.logical_or(a_lt_b, tf.math.logical_and(tf.math.equal(a, b), inside_comparison))
    return inside_comparison