fba10af9db5edd61f78ccdb9d115c4eafbcc561d,fairseq/search.py,Search,_init_buffers,#Search#Any#,22

Before Change


    def _init_buffers(self, t):
        if self.scores_buf is None:
            self.scores_buf = t.new()
            self.indices_buf = torch.LongTensor().to(device=t.device)
            self.beams_buf = torch.LongTensor().to(device=t.device)

    def step(self, step, lprobs, scores):
        Take a single search step.

After Change


        if not self.scores_buf.size()[0]:
            self.scores_buf = torch.empty(0).to(t)
            self.indices_buf = torch.empty(0).to(t).long()
            self.beams_buf = torch.empty(0).to(t).long()

    def step(self, step, lprobs, scores):
        Take a single search step.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


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


Project Name: arraiy/torchgeometry
Commit Name: 7634391b070859dc1c11b092fde754dbc7911d4a
Time: 2021-01-12
Author: edgar.riba@gmail.com
File Name: test/test_losses.py
Class Name: TestDepthSmoothnessLoss
Method Name: test_smoke