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

Small fixes

parent 56f9ec3c
...@@ -38,7 +38,7 @@ class LabelSmoothedNLLLoss(torch.autograd.Function): ...@@ -38,7 +38,7 @@ class LabelSmoothedNLLLoss(torch.autograd.Function):
ctx.grad_input = grad_input ctx.grad_input = grad_input
if reduce: if reduce:
return input.new([grad_input.view(-1).dot(input.view(-1))]) return grad_input.view(-1).dot(input.view(-1))
else: else:
return grad_input * input return grad_input * input
......
...@@ -46,7 +46,7 @@ class SequenceScorer(object): ...@@ -46,7 +46,7 @@ class SequenceScorer(object):
'alignment': alignment, 'alignment': alignment,
'positional_scores': pos_scores_i, '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 yield id, src, ref, hypos
def score(self, sample): def score(self, sample):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment