Skip to content

Commit

Permalink
chore: fix mypy errors in test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
justindujardin committed Feb 2, 2021
1 parent ec6b551 commit 1be4a17
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions thinc/tests/backends/test_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

MAX_EXAMPLES = 10

VANILLA_OPS = Ops(numpy)
VANILLA_OPS = Ops(numpy) # type:ignore
NUMPY_OPS = NumpyOps()
BLIS_OPS = NumpyOps(use_blis=True)
CPU_OPS = [NUMPY_OPS, VANILLA_OPS]
Expand Down Expand Up @@ -365,7 +365,7 @@ def get_lstm_args(depth, dirs, nO, batch_size, nI, draw=None):
if draw:
params = draw(ndarrays_of_shape(n_params))
# For some reason this is crashing hypothesis?
#size_at_t = draw(ndarrays_of_shape(shape=(batch_size,), lo=1, dtype="int32"))
# size_at_t = draw(ndarrays_of_shape(shape=(batch_size,), lo=1, dtype="int32"))
size_at_t = numpy.ones(shape=(batch_size,), dtype="int32")
X = draw(ndarrays_of_shape((int(size_at_t.sum()), nI)))
else:
Expand Down
10 changes: 5 additions & 5 deletions thinc/tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
(numpy.array(1), 0),
(numpy.array([1, 2]), 3),
([numpy.zeros((1, 2)), numpy.zeros((1))], 2),
(Ragged(numpy.zeros((1, 2)), numpy.zeros(1)), 2),
(Ragged(numpy.zeros((1, 2)), numpy.zeros(1)), 2), # type:ignore
(
Padded(
numpy.zeros((2, 1, 2)),
numpy.zeros(2),
numpy.array([1, 0]),
numpy.array([0, 1]),
numpy.zeros((2, 1, 2)), # type:ignore
numpy.zeros(2), # type:ignore
numpy.array([1, 0]), # type:ignore
numpy.array([0, 1]), # type:ignore
),
2,
),
Expand Down

0 comments on commit 1be4a17

Please sign in to comment.