def log_diagnostic(self, global_step: int, epoch: int, summary: Diagnostic, best_score: Optional[BestScore]=None, **kwargs):
    for stats_key in self.diagnostic_keys:
        if (not (stats_key in summary.keys())):
            self.logger.warning((('key ' + str(stats_key)) + ' not in summary.'))
        else:
            message = f'[{global_step} / {epoch}]   '
            message += ''.join([f'{k} {v:6.2f}   ' for (k, v) in summary.get(stats_key).items()])
            if (('info' in summary.keys()) and ('elapsed-time' in summary['info'].keys())):
                message += f"({summary['info']['elapsed-time']:.2f}s /iter)"
            else:
                warnings.warn(f"Summary does not contain the key info/elapsed-time. The elapsed time won't be displayed.")
            if (best_score is not None):
                message += f'   (best: {best_score.value:6.2f}  [{best_score.step} | {best_score.epoch}])'
        self.logger.info(message)
def log_diagnostic(self, global_step: int, epoch: int, summary: Diagnostic, best_score: Optional[BestScore]=None, **kwargs):
    for stats_key in self.diagnostic_keys:
        if (not (stats_key in summary.keys())):
            self.logger.warning((('key ' + str(stats_key)) + ' not in summary.'))
        else:
            message = f'[{global_step} / {epoch}]   '
            message += .join([f'{k} {v:6.2f}   ' for (k, v) in summary.get(stats_key).items()])
            if (('info' in summary.keys()) and ('elapsed-time' in summary['info'].keys())):
                message += f"({summary['info']['elapsed-time']:.2f}s /iter)"
            else:
                warnings.warn(f"Summary does not contain the key info/elapsed-time. The elapsed time won't be displayed.")
            if (best_score is not None):
                message += f'   (best: {best_score.value:6.2f}  [{best_score.step} | {best_score.epoch}])'
        self.logger.info(message)