Skip to content

Commit

Permalink
warnings for direct syn0/syn0norm access
Browse files Browse the repository at this point in the history
  • Loading branch information
jayantj committed Sep 9, 2016
1 parent 9dbdc43 commit dccb7e3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gensim/models/word2vec.py
Original file line number Diff line number Diff line change
Expand Up @@ -1222,26 +1222,32 @@ def __getitem__(self, words):

@property
def syn0norm(self):
logger.warn('direct access to syn0norm will not be supported in future gensim releases, please use model.kv.syn0norm')
return self.kv.syn0norm

@syn0norm.setter
def syn0norm(self, value):
logger.warn('direct access to syn0norm will not be supported in future gensim releases, please use model.kv.syn0norm')
self.kv.syn0norm = value

@syn0norm.deleter
def syn0norm(self):
logger.warn('direct access to syn0norm will not be supported in future gensim releases, please use model.kv.syn0norm')
del self.kv.syn0norm

@property
def syn0(self):
logger.warn('direct access to syn0norm will not be supported in future gensim releases, please use model.kv.syn0')
return self.kv.syn0

@syn0.setter
def syn0(self, value):
logger.warn('direct access to syn0norm will not be supported in future gensim releases, please use model.kv.syn0')
self.kv.syn0 = value

@syn0.deleter
def syn0(self):
logger.warn('direct access to syn0norm will not be supported in future gensim releases, please use model.kv.syn0')
del self.kv.syn0

@property
Expand Down

0 comments on commit dccb7e3

Please sign in to comment.