b03b53b426deaa8bdf6c93d91e424c5571acf7e5,fairseq/sequence_generator.py,SequenceGenerator,generate_batched_itr,#SequenceGenerator#Any#Any#Any#Any#Any#Any#Any#,52
Before Change
for i, id in enumerate(s["id"].data):
src = input["src_tokens"].data[i, :]
// remove padding from ref
ref = utils.strip_pad(s["target"].data[i, :], self.pad)
yield id, src, ref, hypos[i]
def generate(self, src_tokens, src_lengths, beam_size=None, maxlen=None, prefix_tokens=None):
Generate a batch of translations.
After Change
for i, id in enumerate(s["id"].data):
src = input["src_tokens"].data[i, :]
// remove padding from ref
ref = utils.strip_pad(s["target"].data[i, :], self.pad) if s["target"] is not None else None
yield id, src, ref, hypos[i]
def generate(self, src_tokens, src_lengths, beam_size=None, maxlen=None, prefix_tokens=None):
Generate a batch of translations.
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 5
Instances
Project Name: pytorch/fairseq
Commit Name: b03b53b426deaa8bdf6c93d91e424c5571acf7e5
Time: 2018-03-05
Author: edunov@apache.org
File Name: fairseq/sequence_generator.py
Class Name: SequenceGenerator
Method Name: generate_batched_itr
Project Name: elbayadm/attn2d
Commit Name: c53b2ee06a3d4f9e18014a75bfacba8d731071ab
Time: 2018-06-15
Author: myleott@fb.com
File Name: fairseq/sequence_scorer.py
Class Name: SequenceScorer
Method Name: score_batched_itr