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

Before Change


        masked_indices.remainder_(self.compressed_num_embeddings)
        masked_indices = Variable(masked_indices)

        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


        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)

        torch.mul(
            indices.expand_as(masks),
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

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: cornellius-gp/gpytorch
Commit Name: 979b8c9efa551e8c948a4aca145367a2d87ac8d6
Time: 2019-02-26
Author: balandat@fb.com
File Name: gpytorch/distributions/multitask_multivariate_normal.py
Class Name: MultitaskMultivariateNormal
Method Name: rsample


Project Name: asappresearch/sru
Commit Name: faf3aa876462323f2fa721ebd633752d6489808f
Time: 2020-09-18
Author: taolei@csail.mit.edu
File Name: sru/modules.py
Class Name: SRU
Method Name: forward