def on_phase_end(self):
    self.log_phase_end('train')
    if self.train:
        self.optimizer.on_epoch(where=self.where)
    logging.debug('Syncing losses on phase end...')
    self.synchronize_losses()
    logging.debug('...losses synced')
    logging.debug('Syncing meters on phase end...')
    for meter in self.meters:
        meter.sync_state()
    logging.debug('...meters synced')
    barrier()
    for hook in self.hooks:
        hook.on_phase_end(self)
    self.perf_log = []
    self.log_phase_end('total')
def on_phase_end(self):
    self.log_phase_end('train')
    if self.train:
        self.optimizer.on_epoch(where=self.where)
    logging.debug('Syncing losses on phase end...')
    self.synchronize_losses()
    logging.debug('...losses synced')
    logging.debug('Syncing meters on phase end...')
    for meter in self.meters:
        meter.sync_state()
    logging.debug('...meters synced')
    barrier()
    for hook in self.hooks:
        hook.on_phase_end(self)
    self.perf_log = []
    self.log_phase_end('total')