f255b7f90185f4bb38f23ad2499361443177fdd6,test/test_models.py,TestModel,embeddings_forward,#TestModel#Any#Any#Any#,41
Before Change
"""
vocab = self.get_vocab()
feats_padding_idx = []
emb = make_embeddings(opt, vocab.stoi[onmt.IO.PAD_WORD],
feats_padding_idx, len(vocab),
for_encoder=True)
test_src, _, __ = self.get_batch(sourceL=sourceL,
bsize=bsize)
if opt.decoder_type == "transformer":
input = torch.cat([test_src, test_src], 0)
After Change
"""
word_dict = self.get_vocab()
feature_dicts = []
emb = make_embeddings(opt, word_dict, feature_dicts)
test_src, _, __ = self.get_batch(sourceL=sourceL,
bsize=bsize)
if opt.decoder_type == "transformer":
input = torch.cat([test_src, test_src], 0)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 10
Instances
Project Name: OpenNMT/OpenNMT-py
Commit Name: f255b7f90185f4bb38f23ad2499361443177fdd6
Time: 2017-09-12
Author: nasa4836@gmail.com
File Name: test/test_models.py
Class Name: TestModel
Method Name: embeddings_forward
Project Name: OpenNMT/OpenNMT-py
Commit Name: f255b7f90185f4bb38f23ad2499361443177fdd6
Time: 2017-09-12
Author: nasa4836@gmail.com
File Name: test/test_models.py
Class Name: TestModel
Method Name: encoder_forward
Project Name: OpenNMT/OpenNMT-py
Commit Name: f255b7f90185f4bb38f23ad2499361443177fdd6
Time: 2017-09-12
Author: nasa4836@gmail.com
File Name: tools/extract_embeddings.py
Class Name:
Method Name: main