def _maybe_gather_stats(self, stat): """ Gather statistics in multi-processes cases Args: stat(:obj:onmt.utils.Statistics): a Statistics object to gather or None (it returns None in this case) Returns: stat: the updated (or unchanged) stat object """ if stat is not None and self.n_gpu > 1: return Statistics.all_gather_stats(stat) return stat
def _maybe_gather_stats(self, stat): """Gathers statistics in multi-processes cases. """ if stat is not None and self.n_gpu > 1: return Statistics.all_gather_stats(stat) return stat