bc51dbc0c56f68ed30857755026633f78eef1ae8,spotlight/layers.py,BloomEmbedding,forward,#BloomEmbedding#Any#,171
Before Change
if masked_indices.dim() == 2:
embedding = self.embeddings(masked_indices).mean(1)
else:
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
batch_size, seq_size = indices.size(0), 1
if not indices.is_contiguous():
indices = indices.contiguous()
indices = indices.data.view(batch_size * seq_size, 1)
torch.mul(
indices.expand_as(masks),
masks,
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: 68fbfd1876c367323acf830736bae1af499cc0fe
Time: 2018-03-07
Author: dengyuntian@gmail.com
File Name: onmt/modules/Transformer.py
Class Name: TransformerDecoder
Method Name: forward
Project Name: rusty1s/pytorch_geometric
Commit Name: 5a9c6aa03ea55ad85601c0c33ff762d6a2e2c7fa
Time: 2020-05-23
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/nn/models/node2vec.py
Class Name: Node2Vec
Method Name: loss
Project Name: SeanNaren/deepspeech.pytorch
Commit Name: 9ea14875825b2ab63a43ad2f0f5159d99df86d02
Time: 2019-07-29
Author: rasmus.arpe@gmail.com
File Name: model.py
Class Name: Lookahead
Method Name: forward