From e0d433b00527901e7b2f103252e16d581a49f51c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danie=CC=88l=20de=20Kok?= Date: Tue, 21 Feb 2023 14:38:51 +0100 Subject: [PATCH] Write out condition more explicitly --- spacy/ml/tb_framework.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/ml/tb_framework.pyx b/spacy/ml/tb_framework.pyx index 0be77bfba..9b2114900 100644 --- a/spacy/ml/tb_framework.pyx +++ b/spacy/ml/tb_framework.pyx @@ -249,7 +249,7 @@ cdef list _parse_batch(CBlas cblas, TransitionSystem moves, StateC** states, cdef np.ndarray step_actions scores = [] - while sizes.states >= 1 and (actions is None or actions): + while sizes.states >= 1 and (actions is None or len(actions) > 0): step_scores = numpy.empty((sizes.states, sizes.classes), dtype="f") step_actions = actions[0] if actions is not None else None assert step_actions is None or step_actions.size == sizes.states, \