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
masked_indices) = self._initialize_caches(indices)
if indices.dim() == 2:
batch_size, seq_size = indices.size()
else:
batch_size, seq_size = indices.size(0), 1
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
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: 809d0e5b52561fefd3b0d98c08d3cbb175d7e706
Time: 2017-07-04
Author: sasha.rush@gmail.com
File Name: onmt/Models.py
Class Name: Encoder
Method Name: forward
Project Name: maciejkula/spotlight
Commit Name: 06a07d00d11fb103a079a9adb0de4c3865a7f69e
Time: 2017-08-19
Author: maciej.kula@gmail.com
File Name: spotlight/layers.py
Class Name: BloomEmbedding
Method Name: forward