提交 75935a11 authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Added regression test for bug fixed in blas opt

This test ensures that integer scalars are properly cast to floats to be included within a dot22scalar op.
上级 2d774b33
......@@ -821,6 +821,19 @@ def test_dot22scalar():
cmp((0,4),(4,0),(0,0))
cmp((0,0),(0,0),(0,0))
def test_dot22scalar_cast():
"""
Test that in `dot22_to_dot22scalar` we properly cast integers to floats.
"""
# Note that this test was failing before d5ff6904.
A = T.matrix()
for scalar_int_type in T.int_dtypes:
y = T.scalar(dtype=scalar_int_type)
f = theano.function([A, y], T.dot(A, A) * y, mode=mode_blas_opt)
assert _dot22scalar in [x.op for x in f.maker.env.toposort()]
def test_dot_w_self():
# This can trigger problems in the optimization because what would normally be a gemm must
# not be because the output is aliased to one of the inputs.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论