提交 2cea580e authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Fix mistakes.

上级 7aa2d1a9
......@@ -16,6 +16,8 @@ import theano.sandbox.cuda.dnn as dnn
from theano.sandbox.cuda.basic_ops import GpuAllocEmpty, gpu_alloc_empty
from theano.sandbox.cuda import float32_shared_constructor as shared
from . import test_nnet
# Skip test if cuda_ndarray is not available.
import theano.sandbox.cuda as cuda
if not cuda.cuda_available:
......@@ -451,10 +453,11 @@ def test_pooling_opt():
for n in f.maker.fgraph.toposort()])
class test_DnnSoftMax(test_.test_SoftMax):
class test_DnnSoftMax(test_nnet.test_SoftMax):
gpu_op = dnn.GpuDnnSoftmax
gpu_grad_op = dnn.GpuDnnSoftmaxGrad
mode = mode_with_gpu
do_0 = False
topo_idx = -3
def setUp(self):
......@@ -470,7 +473,9 @@ class test_DnnSoftMax(test_.test_SoftMax):
utt.verify_grad(softmax_op, [x_val])
utt.verify_grad(softmax_op, [x_val2])
# Gradient is broken for (n, c, 1, 1) in v3 rc1
if cuda.dnn.version() == (2000, 2000):
utt.verify_grad(softmax_op, [x_val2])
def test_cudnn_softmax_grad_opt(self):
# Verify that the SoftmaxGrad -> GpuDnnSoftmaxGrad optimization is
......
......@@ -299,7 +299,7 @@ class test_SoftMax(unittest.TestCase):
check_types
)
if do_big:
if self.do_big:
self._cmp(2 << 15, 5, f, f_gpu)
if do_0:
if self.do_0:
self._cmp(0, 10, f, f_gpu)
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论