spancat: replace a cast by an assertion

This commit is contained in:
Daniël de Kok 2022-09-08 10:33:53 +02:00
parent b828954fb6
commit 0bd5730d16

View File

@ -311,8 +311,9 @@ class SpanCategorizer(TrainablePipe):
labels = self.labels
indices = activations["indices"]
scores = activations["scores"]
assert isinstance(indices, Ragged)
scores = cast(Floats2d, activations["scores"])
assert isinstance(scores, Floats2d)
offset = 0
for i, doc in enumerate(docs):