From d58c09dd48bb13a0098857988663aae69552d170 Mon Sep 17 00:00:00 2001 From: accraze Date: Thu, 22 Dec 2016 14:29:05 -0800 Subject: [PATCH] Fix #789 ignore DocvecsArray.doctag_syn0norm in save --- gensim/models/doc2vec.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gensim/models/doc2vec.py b/gensim/models/doc2vec.py index fcb89d280c..00712f0685 100644 --- a/gensim/models/doc2vec.py +++ b/gensim/models/doc2vec.py @@ -353,6 +353,11 @@ def __contains__(self, index): else: return index in self.doctags + def save(self, *args, **kwargs): + # don't bother storing the cached normalized vectors + kwargs['ignore'] = kwargs.get('ignore', ['syn0norm']) + super(DocvecsArray, self).save(*args, **kwargs) + def borrow_from(self, other_docvecs): self.count = other_docvecs.count self.doctags = other_docvecs.doctags