提交 da6d2745 authored 作者: Frederic Bastien's avatar Frederic Bastien

Fix tests when floatX=float32.

上级 8ae14c94
...@@ -990,14 +990,14 @@ class TestDnnInferShapes(utt.InferShapeTester): ...@@ -990,14 +990,14 @@ class TestDnnInferShapes(utt.InferShapeTester):
img_val = numpy.asarray( img_val = numpy.asarray(
numpy.random.rand(*img_shape), numpy.random.rand(*img_shape),
dtype=theano.config.floatX dtype="float32"
) )
topgrad_vals = numpy.asarray( topgrad_vals = numpy.asarray(
numpy.random.rand(*topgrad_shape), numpy.random.rand(*topgrad_shape),
dtype=theano.config.floatX dtype="float32"
) )
kerns_vals = numpy.zeros(kerns_shape, dtype=theano.config.floatX) kerns_vals = numpy.zeros(kerns_shape, dtype="float32")
kerns_shape = theano.shared(numpy.asarray(kerns_shape)) kerns_shape = theano.shared(numpy.asarray(kerns_shape))
topgrad_shape = theano.shared(numpy.asarray(topgrad_shape)) topgrad_shape = theano.shared(numpy.asarray(topgrad_shape))
desc = dnn.GpuDnnConvDesc( desc = dnn.GpuDnnConvDesc(
...@@ -1041,14 +1041,14 @@ class TestDnnInferShapes(utt.InferShapeTester): ...@@ -1041,14 +1041,14 @@ class TestDnnInferShapes(utt.InferShapeTester):
img_val = numpy.asarray( img_val = numpy.asarray(
numpy.random.rand(*img_shape), numpy.random.rand(*img_shape),
dtype=theano.config.floatX dtype="float32"
) )
topgrad_vals = numpy.asarray( topgrad_vals = numpy.asarray(
numpy.random.rand(*topgrad_shape), numpy.random.rand(*topgrad_shape),
dtype=theano.config.floatX dtype="float32"
) )
kerns_vals = numpy.zeros(kerns_shape, dtype=theano.config.floatX) kerns_vals = numpy.zeros(kerns_shape, dtype="float32")
kerns_shape = theano.shared(numpy.asarray(kerns_shape)) kerns_shape = theano.shared(numpy.asarray(kerns_shape))
topgrad_shape = theano.shared(numpy.asarray(topgrad_shape)) topgrad_shape = theano.shared(numpy.asarray(topgrad_shape))
desc = dnn.GpuDnnConvDesc( desc = dnn.GpuDnnConvDesc(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论