提交 eb929b18 authored 作者: Frederic's avatar Frederic

fix test with floatX=float64

上级 000fa06c
...@@ -416,7 +416,7 @@ class test_SoftMax(unittest.TestCase): ...@@ -416,7 +416,7 @@ class test_SoftMax(unittest.TestCase):
# Verify that the SoftmaxGrad -> GpuDnnSoftmaxGrad optimization is not # Verify that the SoftmaxGrad -> GpuDnnSoftmaxGrad optimization is not
# applied when cudnn is excluded or not available # applied when cudnn is excluded or not available
mode_wo_cudnn = mode_with_gpu.excluding("cudnn") mode_wo_cudnn = mode_with_gpu.excluding("cudnn")
y = T.vector('y') y = T.fvector('y')
f = theano.function( f = theano.function(
[y], [y],
T.grad(T.nnet.softmax(y).mean(), y), T.grad(T.nnet.softmax(y).mean(), y),
...@@ -438,7 +438,7 @@ class test_SoftMax(unittest.TestCase): ...@@ -438,7 +438,7 @@ class test_SoftMax(unittest.TestCase):
# Verify that the SoftmaxGrad -> GpuDnnSoftmaxGrad do not # Verify that the SoftmaxGrad -> GpuDnnSoftmaxGrad do not
# crash with manual graph # crash with manual graph
y = T.vector('y') y = T.fvector('y')
o = theano.tensor.nnet.SoftmaxGrad()(y, y*2) o = theano.tensor.nnet.SoftmaxGrad()(y, y*2)
f = theano.function([y], o, mode=mode_with_gpu) f = theano.function([y], o, mode=mode_with_gpu)
sorted_f = f.maker.fgraph.toposort() sorted_f = f.maker.fgraph.toposort()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论