a8a4fcbaff669c30a1b6de26f4c27ad5c8d658c4,examples/pytorch/tree_lstm/tree_lstm.py,TreeLSTM,forward,#TreeLSTM#Any#Any#Any#Any#Any#Any#,86

Before Change


        g.register_apply_node_func(self.cell.apply_func, batchable=True)
        // feed embedding
        embeds = self.embedding(batch.wordid)
        x = zero_initializer((n, self.x_size))
        x = x.index_copy(0, batch.nid_with_word, embeds)
        if h is None:
            h = zero_initializer((n, self.h_size))

After Change


        // feed embedding
        wordid = g.pop_n_repr("x")
        mask = (wordid != dgl.data.SST.PAD_WORD)
        wordid = wordid * mask.long()
        embeds = self.embedding(wordid)
        x = embeds * th.unsqueeze(mask, 1).float()
        if h is None:
            h = zero_initializer((n, self.h_size))
        h_tild = zero_initializer((n, self.h_size))
        if c is None:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 4

Instances


Project Name: dmlc/dgl
Commit Name: a8a4fcbaff669c30a1b6de26f4c27ad5c8d658c4
Time: 2018-09-24
Author: wmjlyjemaine@gmail.com
File Name: examples/pytorch/tree_lstm/tree_lstm.py
Class Name: TreeLSTM
Method Name: forward


Project Name: pytorch/fairseq
Commit Name: 4fed0beca64a52aa718371dc3b2cf1fd979197a4
Time: 2021-02-10
Author: patrick.v.platen@gmail.com
File Name: fairseq/models/wav2vec/wav2vec2.py
Class Name: Wav2Vec2Model
Method Name: forward


Project Name: rusty1s/pytorch_geometric
Commit Name: b48c943b9f6248dbdd42d0fce44658b937098372
Time: 2017-10-23
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/nn/functional/spline_gcn.py
Class Name:
Method Name: spline_gcn


Project Name: rusty1s/pytorch_geometric
Commit Name: 5980bd68fcd65ffe90fe560ff7db3f01e861426e
Time: 2017-11-02
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/transform/graclus.py
Class Name:
Method Name: normalized_cut


Project Name: ncullen93/torchsample
Commit Name: 943753c968fe7c0cbafc6e44d60f1b28b42e997b
Time: 2017-05-03
Author: ncullen.th@dartmouth.edu
File Name: torchsample/utils.py
Class Name:
Method Name: th_nearest_interp2d