Commit 5f29d123 authored by Myle Ott's avatar Myle Ott Committed by Sergey Edunov
Browse files

Small fixes

parent 56f9ec3c
Loading
Loading
Loading
Loading
+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
@@ -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

+1 −1
Changes for fairseq/sequence_scorer.py: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -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):