Fix vector linkage on Doc

This commit is contained in:
Matthew Honnibal 2017-06-04 14:25:30 -05:00
parent f4662e9218
commit 675f448313
1 changed files with 2 additions and 2 deletions

View File

@ -255,7 +255,7 @@ cdef class Doc:
return self.user_hooks['has_vector'](self) return self.user_hooks['has_vector'](self)
elif any(token.has_vector for token in self): elif any(token.has_vector for token in self):
return True return True
elif self.tensor: elif self.tensor is not None:
return True return True
else: else:
return False return False
@ -275,7 +275,7 @@ cdef class Doc:
elif self.has_vector and len(self): elif self.has_vector and len(self):
self._vector = sum(t.vector for t in self) / len(self) self._vector = sum(t.vector for t in self) / len(self)
return self._vector return self._vector
elif self.tensor: elif self.tensor is not None:
self._vector = self.tensor.mean(axis=0) self._vector = self.tensor.mean(axis=0)
return self._vector return self._vector
else: else: