From a52d466bfcb13d4e15cd0cba945b7862209c2cee Mon Sep 17 00:00:00 2001 From: svlandeg Date: Thu, 11 Feb 2021 20:50:55 +0100 Subject: [PATCH] any instead of all --- spacy/pipeline/tok2vec.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/pipeline/tok2vec.py b/spacy/pipeline/tok2vec.py index 61ba498c9..4a396eaeb 100644 --- a/spacy/pipeline/tok2vec.py +++ b/spacy/pipeline/tok2vec.py @@ -291,7 +291,7 @@ def forward(model: Tok2VecListener, inputs, is_train: bool): # of data. # When the components batch differently, we don't receive a matching # prediction from the upstream, so we can't predict. - if not all(doc.tensor.size for doc in inputs): + if not any(doc.tensor.size for doc in inputs): # But we do need to do *something* if the tensor hasn't been set. # The compromise is to at least return data of the right shape, # so the output is valid.