From 78301b2d29fe0c37fb05d98b3cf141cc3d6b060a Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Wed, 20 Sep 2017 00:19:34 +0200 Subject: [PATCH] Avoid comparison to None in Tok2Vec --- spacy/_ml.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spacy/_ml.py b/spacy/_ml.py index d79d6e39b..eaf72b44f 100644 --- a/spacy/_ml.py +++ b/spacy/_ml.py @@ -227,6 +227,8 @@ def drop_layer(layer, factor=2.): def Tok2Vec(width, embed_size, pretrained_dims=0): + if pretrained_dims is None: + pretrained_dims = 0 cols = [ID, NORM, PREFIX, SUFFIX, SHAPE, ORTH] with Model.define_operators({'>>': chain, '|': concatenate, '**': clone, '+': add}): norm = HashEmbed(width, embed_size, column=cols.index(NORM), name='embed_norm')