don't rely on doc._.trf_data
@@ -54,11 +54,7 @@ class TransformerListener(Model):
def forward(model: TransformerListener, docs, is_train):
- if is_train:
- model.verify_inputs(docs)
- return model._outputs, model.backprop_and_clear
- else:
if len(docs) == 0:
return [TransformerData.empty()], lambda d_data: docs
- else:
- return [doc._.trf_data for doc in docs], lambda d_data: docs
+ model.verify_inputs(docs)
+ return model._outputs, model.backprop_and_clear
