def shutdown(self):
    logger.log(self.status_loglevel, 'Sending goodbye to peers...')
    self.tracker.shutdown(self.shutdown_timeout)
    self.state_averager.step(wait_for_delayed_updates=True)
    for scheduled_round in (self.scheduled_grads, self.scheduled_state):
        if (scheduled_round is not None):
            if (scheduled_round.stage == AveragingStage.LOOKING_FOR_GROUP):
                scheduled_round.cancel()
            else:
                self._tag_along_with_zero_weight(scheduled_round)
    logger.log(self.status_loglevel, 'Shutting down averagers...')
    self.state_averager.shutdown()
    if self.use_gradient_averaging:
        self.grad_averager.shutdown()
    logger.log(self.status_loglevel, f'{self.__class__.__name__} is shut down')
def shutdown(self):
    logger.log(self.status_loglevel, 'Sending goodbye to peers...')
    self.tracker.shutdown(self.shutdown_timeout)
    self.state_averager.step(wait_for_delayed_updates=True)
    for scheduled_round in (self.scheduled_grads, self.scheduled_state):
        if (scheduled_round is not None):
            if (scheduled_round.stage == AveragingStage.LOOKING_FOR_GROUP):
                scheduled_round.cancel()
            else:
                self._tag_along_with_zero_weight(scheduled_round)
    logger.log(self.status_loglevel, 'Shutting down averagers...')
    self.state_averager.shutdown()
    if self.use_gradient_averaging:
        self.grad_averager.shutdown()
    logger.log(self.status_loglevel, f'{self.__class__.__name__} is shut down')