9d7725226da3fcd9c5d1ac02473289f53cd7dd78,fairseq/tasks/language_modeling.py,LanguageModelingTask,inference_step,#LanguageModelingTask#Any#Any#Any#Any#,208

Before Change


        with torch.no_grad():
            if prefix_tokens is None and sample["net_input"]["src_tokens"].nelement():
                prefix_tokens = sample["net_input"]["src_tokens"]
                if prefix_tokens[:, 0].eq(self.source_dictionary.eos()).all():
                    prefix_tokens = prefix_tokens[:, 1:]
            if getattr(self.args, "add_bos_token", False):
                bos_token = self.source_dictionary.bos()

After Change


            if getattr(self.args, "add_bos_token", False):
                bos_token = self.source_dictionary.bos()
            else:
                bos_token = self.source_dictionary.eos()

            // SequenceGenerator doesn"t use src_tokens directly, we need to
            // pass the `prefix_tokens` argument instead
            if prefix_tokens is None and sample["net_input"]["src_tokens"].nelement():
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: elbayadm/attn2d
Commit Name: 9d7725226da3fcd9c5d1ac02473289f53cd7dd78
Time: 2019-12-18
Author: myleott@fb.com
File Name: fairseq/tasks/language_modeling.py
Class Name: LanguageModelingTask
Method Name: inference_step


Project Name: elbayadm/attn2d
Commit Name: 9d7725226da3fcd9c5d1ac02473289f53cd7dd78
Time: 2019-12-18
Author: myleott@fb.com
File Name: fairseq/tasks/language_modeling.py
Class Name: LanguageModelingTask
Method Name: build_dataset_for_inference