def find_latest_h5_checkpoint()

in 5-appinfra/modules/hpc-ai-training-infra/tensorflow_mnist_train_distributed.py [0:0]


def find_latest_h5_checkpoint(checkpoint_dir):
    list_of_files = glob.glob(f'{checkpoint_dir}/*.h5')
    if list_of_files:
        latest_file = max(list_of_files, key=os.path.getctime)
        return latest_file
    else:
        return None