bc51dbc0c56f68ed30857755026633f78eef1ae8,spotlight/layers.py,BloomEmbedding,forward,#BloomEmbedding#Any#,171

Before Change


            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),
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

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: PetrochukM/PyTorch-NLP
Commit Name: 92f045a4e7cb5996f5378309e19e23cf0cfe6923
Time: 2018-05-05
Author: petrochukm@gmail.com
File Name: torchnlp/utils.py
Class Name:
Method Name: pad_batch


Project Name: Alexander-H-Liu/End-to-end-ASR-Pytorch
Commit Name: 41a3e20440c61f4892d7731f89032b53932cce66
Time: 2019-08-14
Author: alexliu36@gmail.com
File Name: src/solver.py
Class Name: Trainer
Method Name: exec