b53df9d822949027e32e926cb833e05bd381ebcf,pytext/torchscript/module.py,PyTextLayerModuleWithDense,forward,#PyTextLayerModuleWithDense#Any#Any#,1178
Before Change
texts: List[str],
dense_feat: List[List[float]],
):
logits = super().forward(texts, dense_feat)
return self.output_layer(logits)
After Change
dense_tensor = torch.tensor(dense_feat, dtype=torch.float)
if self.tensorizer.device != "":
dense_tensor = dense_tensor.to(self.tensorizer.device)
logits = self.model(input_tensors, dense_tensor)
// </>logits = super().forward(texts, dense_feat)
return self.output_layer(logits)
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 3
Instances
Project Name: facebookresearch/pytext
Commit Name: b53df9d822949027e32e926cb833e05bd381ebcf
Time: 2020-11-15
Author: mikekg@fb.com
File Name: pytext/torchscript/module.py
Class Name: PyTextLayerModuleWithDense
Method Name: forward
Project Name: elbayadm/attn2d
Commit Name: b3ca86a800729222e770937d6454f65ab5947ec5
Time: 2020-02-24
Author: chenliu8@fb.com
File Name: fairseq/search.py
Class Name: DiverseSiblingsSearch
Method Name: step
Project Name: facebookresearch/pytext
Commit Name: b53df9d822949027e32e926cb833e05bd381ebcf
Time: 2020-11-15
Author: mikekg@fb.com
File Name: pytext/torchscript/module.py
Class Name: PyTextEmbeddingModuleWithDenseIndex
Method Name: _forward