db7b74579181f9cbae3583f447d83148714a1c3d,stanza/models/classifiers/cnn_classifier.py,CNNClassifier,forward,#CNNClassifier#Any#Any#,83
Before Change
if self.max_window > max_phrase_len:
max_phrase_len = self.max_window
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)
After Change
for i in range(end_pad_width):
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
In pattern: SUPERPATTERN
Frequency: 3
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: 631d4ee2ece28da70d6e22201129f39b4f1dc586
Time: 2020-10-26
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/data/temporal.py
Class Name: TemporalData
Method Name: __getitem__
Project Name: allenai/allennlp
Commit Name: 44d2847610944f56a06b7cfa54faadb66e130a83
Time: 2020-08-12
Author: akshita23bhagia@gmail.com
File Name: allennlp/training/metrics/categorical_accuracy.py
Class Name: CategoricalAccuracy
Method Name: __call__