(self, stat)
return 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
Gather statistics in multi-processes cases
Gather statistics in multi - processes cases
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 onmt.utils.Statistics.all_gather_stats(stat)
        return stat
def _maybe_gather_stats ( self , stat ) : if stat is not None and self . n_gpu > 1 : return onmt . utils . Statistics . all_gather_stats ( stat ) return stat