提交 47fcb406 authored 作者: Frederic's avatar Frederic

Fix since partial revert

上级 791b628b
...@@ -161,18 +161,18 @@ def test_dot22scalar(): ...@@ -161,18 +161,18 @@ def test_dot22scalar():
[a, b], [a, b],
tensor.dot(a, b) * numpy.asarray(4, 'float32')) tensor.dot(a, b) * numpy.asarray(4, 'float32'))
t = f.maker.fgraph.toposort() t = f.maker.fgraph.toposort()
assert any([isinstance(n.op, tcn.blas.GpuGemm) for n in t]) assert any([isinstance(n.op, tcn.blas.GpuDot22Scalar) for n in t])
assert any([isinstance(n.op, tcn.basic_ops.GpuAllocEmpty) # assert any([isinstance(n.op, tcn.basic_ops.GpuAllocEmpty)
for n in t]) # for n in t])
assert numpy.allclose(f(av, bv), f2(av, bv)) assert numpy.allclose(f(av, bv), f2(av, bv))
f = theano.function([a, b, scalar], tensor.dot(a, b) * scalar, f = theano.function([a, b, scalar], tensor.dot(a, b) * scalar,
mode=mode_with_gpu) mode=mode_with_gpu)
f2 = theano.function([a, b, scalar], tensor.dot(a, b) * scalar) f2 = theano.function([a, b, scalar], tensor.dot(a, b) * scalar)
t = f.maker.fgraph.toposort() t = f.maker.fgraph.toposort()
assert any([isinstance(n.op, tcn.blas.GpuGemm) for n in t]) assert any([isinstance(n.op, tcn.blas.GpuDot22Scalar) for n in t])
assert any([isinstance(n.op, tcn.basic_ops.GpuAllocEmpty) # assert any([isinstance(n.op, tcn.basic_ops.GpuAllocEmpty)
for n in t]) # for n in t])
assert numpy.allclose(f(av, bv, 0.5), f2(av, bv, 0.5)) assert numpy.allclose(f(av, bv, 0.5), f2(av, bv, 0.5))
f = theano.function([a, b, scalar], f = theano.function([a, b, scalar],
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论