提交 711f5cfd authored 作者: Frederic Bastien's avatar Frederic Bastien

use the right dtype as we don't silently downcast anymore

上级 e8f198a4
...@@ -37,8 +37,8 @@ def test_pycuda_elemwise_source_module(): ...@@ -37,8 +37,8 @@ def test_pycuda_elemwise_source_module():
assert any([ isinstance(node.op, theano.sandbox.cuda.GpuElemwise) for node in f.maker.env.toposort()]) assert any([ isinstance(node.op, theano.sandbox.cuda.GpuElemwise) for node in f.maker.env.toposort()])
assert any([ isinstance(node.op, PycudaElemwiseSourceModuleOp) for node in f2.maker.env.toposort()]) assert any([ isinstance(node.op, PycudaElemwiseSourceModuleOp) for node in f2.maker.env.toposort()])
val1 = numpy.random.rand(5,5) val1 = numpy.asarray(numpy.random.rand(5,5), dtype='float32')
val2 = numpy.random.rand(5,5) val2 = numpy.asarray(numpy.random.rand(5,5), dtype='float32')
#val1 = numpy.ones((5,5)) #val1 = numpy.ones((5,5))
#val2 = numpy.arange(25).reshape(5,5) #val2 = numpy.arange(25).reshape(5,5)
assert (f(val1,val2) == f2(val1,val2)).all() assert (f(val1,val2) == f2(val1,val2)).all()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论