提交 482fd75c authored 作者: Frederic Bastien's avatar Frederic Bastien

make test faster in debug mode.

上级 bf123427
...@@ -1644,23 +1644,20 @@ class T_subtensor(unittest.TestCase): ...@@ -1644,23 +1644,20 @@ class T_subtensor(unittest.TestCase):
def test_grad_list(self): def test_grad_list(self):
data = numpy.random.rand(3) data = numpy.random.rand(4)
idxs = [[i] for i in range(data.shape[0])] idxs = [[i] for i in range(data.shape[0])]
debug_mode = isinstance(theano.compile.mode.get_default_mode(), debug_mode = isinstance(theano.compile.mode.get_default_mode(),
theano.compile.DebugMode) theano.compile.DebugMode)
for i in range(data.shape[0]): for i in range(data.shape[0]):
for j in range(data.shape[0]): for j in range(data.shape[0]):
idxs.append([i,j]) idxs.append([i,j,(i+1)%data.shape[0]])
for i in range(data.shape[0]):
for j in range(data.shape[0]):
for k in range(data.shape[0]):
idxs.append([i,j,k])
self.grad_list_(idxs, data) self.grad_list_(idxs, data)
data = numpy.random.rand(4,3) data = numpy.random.rand(4,3)
self.grad_list_(idxs, data) self.grad_list_(idxs, data)
data = numpy.random.rand(5,3,7) data = numpy.random.rand(4,3,2)
self.grad_list_(idxs, data)
def test_shape_list(self): def test_shape_list(self):
#TODO for all type of subtensor shape #TODO for all type of subtensor shape
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论