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
@torch.jit.export
def _init_buffers(self, t):
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.
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
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: 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: facebookresearch/SentEval
Commit Name: d477e70d888d8501cc0834c47f399a4f65a439d9
Time: 2018-07-13
Author: asabran@fb.com
File Name: senteval/tools/classifier.py
Class Name: PyTorchClassifier
Method Name: prepare_split