bc51dbc0c56f68ed30857755026633f78eef1ae8,spotlight/layers.py,BloomEmbedding,forward,#BloomEmbedding#Any#,171
Before Change
embedding = self.embeddings(masked_indices[:, :, 0])
for idx in range(1, len(self._masks)):
embedding += self.embeddings(masked_indices[:, :, idx])
embedding /= len(self._masks)
return embedding
After Change
masked_indices = Variable(masked_indices)
embedding = self.embeddings(masked_indices)
embedding = embedding.sum(1)
embedding = embedding.view(batch_size, seq_size, -1)
return embedding
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 5
Instances
Project Name: maciejkula/spotlight
Commit Name: bc51dbc0c56f68ed30857755026633f78eef1ae8
Time: 2017-08-20
Author: maciej.kula@gmail.com
File Name: spotlight/layers.py
Class Name: BloomEmbedding
Method Name: forward
Project Name: OpenNMT/OpenNMT-py
Commit Name: 445493da60b46728e81708442a8edaac1a381de6
Time: 2019-02-01
Author: guillaumekln@users.noreply.github.com
File Name: onmt/decoders/transformer.py
Class Name: TransformerDecoderLayer
Method Name: forward
Project Name: deepchem/deepchem
Commit Name: 97d7f88df32ae58875d7534c7c517905a3eb1341
Time: 2020-11-05
Author: mufeili1996@gmail.com
File Name: deepchem/models/torch_models/gat.py
Class Name: GAT
Method Name: forward
Project Name: deepchem/deepchem
Commit Name: f766c92a63fb67a99744dcb82c8c78406fbf905a
Time: 2020-11-04
Author: mufeili1996@gmail.com
File Name: deepchem/models/torch_models/gat.py
Class Name: GAT
Method Name: forward