03cccd0967b3ed660fac93dd9d458543bc3294d5,onmt/Models.py,Embeddings,__init__,#Embeddings#Any#Any#Any#,14
Before Change
def __init__(self, opt, dicts, feature_dicts=None):
self.positional_encoding = opt.position_encoding
if self.positional_encoding:
self.pe = self.make_positional_encodings(opt.word_vec_size, 5000) \
.cuda()
self.word_vec_size = opt.word_vec_size
super(Embeddings, self).__init__()
After Change
def __init__(self, opt, dicts, feature_dicts=None):
self.positional_encoding = opt.position_encoding
if self.positional_encoding:
self.pe = self.make_positional_encodings(opt.word_vec_size, 5000)
if len(opt.gpus) > 0:
self.pe.cuda()
self.word_vec_size = opt.word_vec_size
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: OpenNMT/OpenNMT-py
Commit Name: 03cccd0967b3ed660fac93dd9d458543bc3294d5
Time: 2017-07-13
Author: s.gehrmann@outlook.com
File Name: onmt/Models.py
Class Name: Embeddings
Method Name: __init__
Project Name: OpenNMT/OpenNMT-py
Commit Name: cc9990f27c34a01cb3926c3d6008fb5735cf24ad
Time: 2017-09-05
Author: srush@sum1gpu01.rc.fas.harvard.edu
File Name: onmt/Models.py
Class Name: Embeddings
Method Name: __init__
Project Name: OpenNMT/OpenNMT-py
Commit Name: 7fb209842b6fdff212cb861629eae60f5a890644
Time: 2017-09-05
Author: srush@sum1gpu01.rc.fas.harvard.edu
File Name: onmt/Models.py
Class Name: Embeddings
Method Name: __init__