db7b74579181f9cbae3583f447d83148714a1c3d,stanza/models/classifiers/cnn_classifier.py,CNNClassifier,forward,#CNNClassifier#Any#Any#,83

Before Change



        if max_phrase_len > min(len(x) for x in inputs):
            idx = torch.tensor(self.vocab_map[self.pad], requires_grad=False, device=device)
            pad_vector = self.embedding(idx)

        input_tensor = []
        for phrase in inputs:
            // build a list of the vectors we want for this sentence / phrase

After Change


                indices.append(PAD_ID)

            indices = torch.tensor(indices, requires_grad=False, device=device)
            input_vectors = self.embedding(indices)
            for unknown in unknowns:
                input_vectors[unknown, :] = self.unk

            // we will now have an N x emb_size tensor
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: stanfordnlp/stanza
Commit Name: db7b74579181f9cbae3583f447d83148714a1c3d
Time: 2020-06-15
Author: horatio@gmail.com
File Name: stanza/models/classifiers/cnn_classifier.py
Class Name: CNNClassifier
Method Name: forward


Project Name: rusty1s/pytorch_geometric
Commit Name: 5a9c6aa03ea55ad85601c0c33ff762d6a2e2c7fa
Time: 2020-05-23
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/nn/models/node2vec.py
Class Name: Node2Vec
Method Name: loss


Project Name: pytorch/text
Commit Name: 11b030dadd33dc13f21e214d7bab6e0c9434f9e0
Time: 2019-07-26
Author: cpuhrsch@fb.com
File Name: examples/text_classification/model.py
Class Name: TextSentiment
Method Name: forward


Project Name: dmlc/dgl
Commit Name: 189c2c0907cdff54f733299a93360ddfcff4ccb7
Time: 2019-09-07
Author: mufeili1996@gmail.com
File Name: python/dgl/model_zoo/chem/layers.py
Class Name: EdgeEmbedding
Method Name: forward