Skip to content

Commit

Permalink
hotfix for previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
msperber committed Jul 4, 2018
1 parent 712f878 commit 2348fb8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xnmt/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def _compute_losses(self, generator, ref_corpus, src_corpus, max_num_sents) -> L
batched_src, batched_ref = self.batcher.pack(src_corpus, ref_corpus)
ref_scores = []
for sent_count, (src, ref) in enumerate(zip(batched_src, batched_ref)):
if sent_count >= max_num_sents: break
if max_num_sents and sent_count >= max_num_sents: break
dy.renew_cg(immediate_compute=settings.IMMEDIATE_COMPUTE, check_validity=settings.CHECK_VALIDITY)
loss_expr = self.compute_losses_one(generator, src, ref)
if isinstance(loss_expr.value(), Iterable):
Expand Down

0 comments on commit 2348fb8

Please sign in to comment.