Skip to content

Commit

Permalink
Revert return type for Ops.alloc to Any (#785)
Browse files Browse the repository at this point in the history
* Revert return type for Ops.alloc to Any

Because the stricter type led to mypy failures in spacy, revert the
changes for v8.1 and postpone to a later release.

* Fix import
  • Loading branch information
adrianeboyd authored Oct 12, 2022
1 parent 07b7a09 commit 6332cb9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions thinc/backends/ops.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import math

from typing import Optional, List, Tuple, Sequence, Type, Union, cast, TypeVar
from typing import Iterator, overload
from typing import Iterator, overload, Any
import numpy
import itertools

Expand Down Expand Up @@ -564,7 +564,7 @@ def alloc(
*,
dtype: Optional[DTypes] = "float32",
zeros: bool = True,
) -> ArrayXd:
) -> Any:
"""Allocate an array of a certain shape."""
if isinstance(shape, int):
shape = (shape,)
Expand Down

0 comments on commit 6332cb9

Please sign in to comment.