提交 dcea4e0d authored 作者: Brandon T. Willard's avatar Brandon T. Willard 提交者: Brandon T. Willard

Add numba-scipy requirement and test a SciPy-based Elemwise in Numba

上级 1dc5b06e
...@@ -14,6 +14,7 @@ versioneer ...@@ -14,6 +14,7 @@ versioneer
jax; python_version > '3.6' jax; python_version > '3.6'
jaxlib; python_version > '3.6' jaxlib; python_version > '3.6'
numba numba
numba-scipy>=0.3.0
diff-cover diff-cover
pre-commit pre-commit
isort isort
......
...@@ -93,11 +93,16 @@ def compare_numba_and_py( ...@@ -93,11 +93,16 @@ def compare_numba_and_py(
@pytest.mark.parametrize( @pytest.mark.parametrize(
"inputs, input_vals, output_fn", "inputs, input_vals, output_fn",
[ [
(
[aet.vector()],
[np.random.randn(100).astype(config.floatX)],
lambda x: aet.nnet.sigmoid(x),
),
( (
[aet.vector() for i in range(4)], [aet.vector() for i in range(4)],
[np.random.randn(100).astype(config.floatX) for i in range(4)], [np.random.randn(100).astype(config.floatX) for i in range(4)],
lambda x, y, x1, y1: (x + y) * (x1 + y1) * y, lambda x, y, x1, y1: (x + y) * (x1 + y1) * y,
) ),
], ],
) )
def test_Elemwise(inputs, input_vals, output_fn): def test_Elemwise(inputs, input_vals, output_fn):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论