d3795d6cd1c66ac05dc0f4861ce69ab4680bff3d,fairseq/modules/learned_positional_embedding.py,LearnedPositionalEmbedding,forward,#LearnedPositionalEmbedding#Any#Any#,24

Before Change


            positions = Variable(
                input.data.new(1, 1).fill_(self.padding_idx + input.size(1)))
        else:
            positions = Variable(self.make_positions(input.data))
        return super().forward(positions)

    def max_positions(self):
        Maximum number of supported positions.

After Change


            // positions is the same for every token when decoding a single step
            positions = input.data.new(1, 1).fill_(self.padding_idx + input.size(1))
        else:
            positions = utils.make_positions(input.data, self.padding_idx, self.left_pad)
        return super().forward(Variable(positions))

    def max_positions(self):
        Maximum number of supported positions.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: pytorch/fairseq
Commit Name: d3795d6cd1c66ac05dc0f4861ce69ab4680bff3d
Time: 2018-04-02
Author: myleott@fb.com
File Name: fairseq/modules/learned_positional_embedding.py
Class Name: LearnedPositionalEmbedding
Method Name: forward


Project Name: pytorch/fairseq
Commit Name: e89329d6657e0dbc35d93f663363141ac2da5cdb
Time: 2018-06-15
Author: myleott@fb.com
File Name: fairseq/modules/sinusoidal_positional_embedding.py
Class Name: SinusoidalPositionalEmbedding
Method Name: forward