Loading fairseq/criterions/label_smoothed_cross_entropy.py +1 −1 Changes for fairseq/criterions/label_smoothed_cross_entropy.py: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ class LabelSmoothedNLLLoss(torch.autograd.Function): ctx.grad_input = grad_input if reduce: return input.new([grad_input.view(-1).dot(input.view(-1))]) return grad_input.view(-1).dot(input.view(-1)) else: return grad_input * input Loading fairseq/sequence_scorer.py +1 −1 Changes for fairseq/sequence_scorer.py: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ class SequenceScorer(object): 'alignment': alignment, 'positional_scores': pos_scores_i, }] # return results in the same format as SequenceGenenerator # return results in the same format as SequenceGenerator yield id, src, ref, hypos def score(self, sample): Loading Loading
fairseq/criterions/label_smoothed_cross_entropy.py +1 −1 Changes for fairseq/criterions/label_smoothed_cross_entropy.py: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ class LabelSmoothedNLLLoss(torch.autograd.Function): ctx.grad_input = grad_input if reduce: return input.new([grad_input.view(-1).dot(input.view(-1))]) return grad_input.view(-1).dot(input.view(-1)) else: return grad_input * input Loading
fairseq/sequence_scorer.py +1 −1 Changes for fairseq/sequence_scorer.py: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ class SequenceScorer(object): 'alignment': alignment, 'positional_scores': pos_scores_i, }] # return results in the same format as SequenceGenenerator # return results in the same format as SequenceGenerator yield id, src, ref, hypos def score(self, sample): Loading