def initialize_session(world_rank, train_func):
    try:
        init_session(training_func=train_func, world_rank=world_rank)
    except ValueError:
        raise SGDBackendError('Attempting to start training but a previous training run is still ongoing. You must call `finish_training` before calling `start_training` again.')
def initialize_session(world_rank, train_func):
    try:
        init_session(training_func=train_func, world_rank=world_rank)
    except ValueError:
        raise SGDBackendError('Attempting to start training but a previous training run is still ongoing. You must call `finish_training` before calling `start_training` again.')