@staticmethod
def index_of_ckpt_with_iter(ckpts_with_iterations, target_ckpt_itr):
    """ given a sorted list `ckpts_with_iterations` of (ckpt_iter, ckpt_path), returns the smallest index i in that
        list where target_ckpt_itr >= ckpt_iter """
    for i, (ckpt_iter, _) in reversed(list(enumerate(ckpts_with_iterations))):
        if target_ckpt_itr >= ckpt_iter:
            return i
    raise ValueError('*** Cannot find ckpt with iter >= {} in {}'.format(
        target_ckpt_itr, ckpts_with_iterations))
