mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-26 01:04:34 +03:00
Only receive from listener if listener exists
This commit is contained in:
parent
cef97e4b63
commit
e4d0990857
|
@ -193,7 +193,8 @@ class Tok2Vec(Pipe):
|
|||
batch_id = Tok2VecListener.get_batch_id(docs)
|
||||
for listener in self.listeners[:-1]:
|
||||
listener.receive(batch_id, tokvecs, accumulate_gradient)
|
||||
self.listeners[-1].receive(batch_id, tokvecs, backprop)
|
||||
if self.listeners:
|
||||
self.listeners[-1].receive(batch_id, tokvecs, backprop)
|
||||
if set_annotations:
|
||||
self.set_annotations(docs, tokvecs)
|
||||
return losses
|
||||
|
|
Loading…
Reference in New Issue
Block a user