(self, loss, scores, target)
return onmt.utils.Statistics(loss.item(), num_non_padding, num_correct)
Args:
            loss (:obj:`FloatTensor`): the loss computed by the loss criterion.
            scores (:obj:`FloatTensor`): a score for each possible output
            target (:obj:`FloatTensor`): true targets

        Returns:
            :obj:`onmt.utils.Statistics` : statistics for this batch.
Args:
            loss (:obj:`FloatTensor`): the loss computed by the loss criterion.
            scores (:obj:`FloatTensor`): a score for each possible output
            target (:obj:`FloatTensor`): true targets
Args : loss ( : obj : FloatTensor ) : the loss computed by the loss criterion . scores ( : obj : FloatTensor ) : a score for each possible output target ( : obj : FloatTensor ) : true targets
def _stats(self, loss, scores, target):
        """
        Args:
            loss (:obj:`FloatTensor`): the loss computed by the loss criterion.
            scores (:obj:`FloatTensor`): a score for each possible output
            target (:obj:`FloatTensor`): true targets

        Returns:
            :obj:`onmt.utils.Statistics` : statistics for this batch.
        """
        pred = scores.max(1)[1]
        non_padding = target.ne(self.padding_idx)
        num_correct = pred.eq(target) \
                          .masked_select(non_padding) \
                          .sum() \
                          .item()
        num_non_padding = non_padding.sum().item()
        return onmt.utils.Statistics(loss.item(), num_non_padding, num_correct)
def _stats ( self , loss , scores , target ) : pred = scores . max ( 1 ) [ 1 ] non_padding = target . ne ( self . padding_idx ) num_correct = pred . eq ( target ) . masked_select ( non_padding ) . sum ( ) . item ( ) num_non_padding = non_padding . sum ( ) . item ( ) return onmt . utils . Statistics ( loss . item ( ) , num_non_padding , num_correct )