From 850ce0583d9480dadb44ccdc6c39ef518ad2ef48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danie=CC=88l=20de=20Kok?= Date: Fri, 13 Jan 2023 15:35:01 +0100 Subject: [PATCH] Use chained conditional --- spacy/ml/tb_framework.pyx | 2 +- spacy/pipeline/transition_parser.pyx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spacy/ml/tb_framework.pyx b/spacy/ml/tb_framework.pyx index d08ff9c6e..f0316d8f9 100644 --- a/spacy/ml/tb_framework.pyx +++ b/spacy/ml/tb_framework.pyx @@ -336,7 +336,7 @@ def _forward_fallback( all_ids.append(ids) all_statevecs.append(statevecs) all_which.append(which) - if max_moves >= 1 and n_moves >= max_moves: + if n_moves >= max_moves >= 1: break n_moves += 1 diff --git a/spacy/pipeline/transition_parser.pyx b/spacy/pipeline/transition_parser.pyx index 9a6543453..085fd8ea8 100644 --- a/spacy/pipeline/transition_parser.pyx +++ b/spacy/pipeline/transition_parser.pyx @@ -381,7 +381,7 @@ class Parser(TrainablePipe): state.c.history.push_back(clas) output.append(costs) batch = [(s, h, g) for s, h, g in batch if len(h) != 0] - if max_moves >= 1 and n_moves >= max_moves: + if n_moves >= max_moves >= 1: break n_moves += 1