def fetch_next_result(self) -> Optional[List[Dict]]:
    'Fetch next results produced by ``sgd.report()`` from each worker.\n\n        Assumes ``start_training`` has already been called.\n\n        Returns:\n            A list of dictionaries of values passed to ``sgd.report()`` from\n                each worker. Each item corresponds to an intermediate result\n                a single worker. If there are no more items to fetch,\n                returns None.\n        '

    def get_next():
        try:
            session = get_session()
        except ValueError:
            raise SGDBackendError('`fetch_next_result` has been called before `start_training`. Please call `start_training` before `fetch_next_result`.')
        try:
            result = session.get_next()
        except RuntimeError:
            raise SGDBackendError('`fetch_next_result` has been called before `start_training`. Please call `start_training` before `fetch_next_result`.')
        return result
    futures = self.worker_group.execute_async(get_next)
    results = self.get_with_failure_handling(futures)
    if any(((r is None) for r in results)):
        if (not all(((r is None) for r in results))):
            raise RuntimeError("Some workers returned results while others didn't. Make sure that `sgd.report()` is called the same number of times on all workers.")
        else:
            results = None
    return results
Fetch next results produced by ``sgd.report()`` from each worker.

Assumes ``start_training`` has already been called.

Returns:
    A list of dictionaries of values passed to ``sgd.report()`` from
        each worker. Each item corresponds to an intermediate result
        a single worker. If there are no more items to fetch,
        returns None.
def fetch_next_result(self) -> Optional[List[Dict]]:
    'Fetch next results produced by ``sgd.report()`` from each worker.\n\n        Assumes ``start_training`` has already been called.\n\n        Returns:\n            A list of dictionaries of values passed to ``sgd.report()`` from\n                each worker. Each item corresponds to an intermediate result\n                a single worker. If there are no more items to fetch,\n                returns None.\n        '

    def get_next():
        try:
            session = get_session()
        except ValueError:
            raise SGDBackendError('`fetch_next_result` has been called before `start_training`. Please call `start_training` before `fetch_next_result`.')
        try:
            result = session.get_next()
        except RuntimeError:
            raise SGDBackendError('`fetch_next_result` has been called before `start_training`. Please call `start_training` before `fetch_next_result`.')
        return result
    futures = self.worker_group.execute_async(get_next)
    results = self.get_with_failure_handling(futures)
    if any(((r is None) for r in results)):
        if (not all(((r is None) for r in results))):
            raise RuntimeError("Some workers returned results while others didn't. Make sure that `sgd.report()` is called the same number of times on all workers.")
        else:
            results = None
    return results