Fix assertion error in staticvectors (#9481)

* Fix assertion error in staticvectors

* Update spacy/ml/staticvectors.py

* Update spacy/ml/staticvectors.py

Co-authored-by: Ines Montani <ines@ines.io>

Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
Co-authored-by: Ines Montani <ines@ines.io>
This commit is contained in:
Edward 2021-10-18 09:10:45 +02:00 committed by GitHub
parent 74ec37f7a8
commit a7cb8de0d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -101,6 +101,5 @@ def _handle_empty(ops: Ops, nO: int):
def _get_drop_mask(ops: Ops, nO: int, rate: Optional[float]) -> Optional[Floats1d]:
if rate is not None:
mask = ops.get_dropout_mask((nO,), rate)
assert isinstance(mask, Floats1d)
return mask
return mask # type: ignore
return None