From e0f5646a4a14544dd6dd0cc60dde1e1c3b0e3238 Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Wed, 25 Nov 2020 13:21:48 +0100 Subject: [PATCH] Restore cleanup_beam method (#6446) --- spacy/syntax/_beam_utils.pyx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spacy/syntax/_beam_utils.pyx b/spacy/syntax/_beam_utils.pyx index 93f5c6fdd..b61b624b8 100644 --- a/spacy/syntax/_beam_utils.pyx +++ b/spacy/syntax/_beam_utils.pyx @@ -304,3 +304,7 @@ def get_gradient(nr_class, beam_maps, histories, losses): grads[j][i, clas] += loss key = key + tuple([clas]) return grads + + +def cleanup_beam(Beam beam): + del beam