def finish_training(self) -> List[T]:
    'Finish training and return final results. Propagate any exceptions.\n\n        Blocks until training is finished on all workers.\n\n        Assumes `start_training` has already been called.\n\n        Returns:\n            A list of return values from calling ``train_func`` on each worker.\n                Each item corresponds to the return value from a single worker.\n        '

    def end_training():
        try:
            session = get_session()
        except ValueError:
            raise SGDBackendError('`finish_training` has been called before `start_training`. Please call `start_training` before `finish_training`.')
        try:
            output = session.finish()
        finally:
            shutdown_session()
        return output
    futures = self.worker_group.execute_async(end_training)
    return self.get_with_failure_handling(futures)
Finish training and return final results. Propagate any exceptions.

Blocks until training is finished on all workers.

Assumes `start_training` has already been called.

Returns:
    A list of return values from calling ``train_func`` on each worker.
        Each item corresponds to the return value from a single worker.
def finish_training(self) -> List[T]:
    'Finish training and return final results. Propagate any exceptions.\n\n        Blocks until training is finished on all workers.\n\n        Assumes `start_training` has already been called.\n\n        Returns:\n            A list of return values from calling ``train_func`` on each worker.\n                Each item corresponds to the return value from a single worker.\n        '

    def end_training():
        try:
            session = get_session()
        except ValueError:
            raise SGDBackendError('`finish_training` has been called before `start_training`. Please call `start_training` before `finish_training`.')
        try:
            output = session.finish()
        finally:
            shutdown_session()
        return output
    futures = self.worker_group.execute_async(end_training)
    return self.get_with_failure_handling(futures)