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])
After Change
if indices.dim() == 2:
batch_size, seq_size = indices.size()
else:
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)
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 3
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: microsoft/nni
Commit Name: e6ef08f367e0389e811d63eaa5afb16183a19e2b
Time: 2020-08-24
Author: 40699903+liuzhe-lz@users.noreply.github.com
File Name: src/sdk/pynni/nni/compression/tensorflow/pruning/one_shot.py
Class Name: LevelPrunerMasker
Method Name: calc_masks
Project Name: asappresearch/sru
Commit Name: bd570b58cefa57062f8c14e06b83800c52f4925a
Time: 2019-09-18
Author: hp@asapp.com
File Name: sru/sru_functional.py
Class Name: SRU
Method Name: forward