07eed27d9fa6f1feaf2d09ba25ff26a643e70b3a,fairseq/search.py,DiverseBeamSearch,step,#DiverseBeamSearch#Any#Any#Any#,130

Before Change


            )

        // initialize diversity penalty
        if self.diversity_buf is None:
            self.diversity_buf = lprobs.new()
        self.diversity_buf.resize_(lprobs[:, 0, :].size())
        torch.zeros(lprobs[:, 0, :].size(), out=self.diversity_buf)

        scores_G, indices_G, beams_G = [], [], []

After Change


            )

        // initialize diversity penalty
        diversity_buf = torch.zeros(lprobs[:, 0, :].size()).to(lprobs)

        scores_G, indices_G, beams_G = [], [], []
        for g in range(self.num_groups):
            lprobs_g = lprobs[:, g :: self.num_groups, :]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: elbayadm/attn2d
Commit Name: 07eed27d9fa6f1feaf2d09ba25ff26a643e70b3a
Time: 2020-02-26
Author: myleott@fb.com
File Name: fairseq/search.py
Class Name: DiverseBeamSearch
Method Name: step


Project Name: pytorch/fairseq
Commit Name: fba10af9db5edd61f78ccdb9d115c4eafbcc561d
Time: 2020-02-14
Author: chenliu8@fb.com
File Name: fairseq/search.py
Class Name: Search
Method Name: _init_buffers