提交 5b2cb6f4 authored 作者: Razvan Pascanu's avatar Razvan Pascanu

merge

...@@ -5,6 +5,7 @@ from theano import function ...@@ -5,6 +5,7 @@ from theano import function
import numpy import numpy
from numpy import array from numpy import array
from numpy.testing import dec
from theano import config from theano import config
from theano.tests import unittest_tools as utt from theano.tests import unittest_tools as utt
...@@ -162,8 +163,14 @@ class T_extending(unittest.TestCase): ...@@ -162,8 +163,14 @@ class T_extending(unittest.TestCase):
fn = lambda x, y: x / y) fn = lambda x, y: x / y)
@dec.knownfailureif(isinstance(theano.compile.mode.get_default_mode(),theano.compile.debugmode.DebugMode),
"This test fail in DEBUG_MODE but this don't make theano generate some bad code. It is a trouble with DEBUG_MODE")
def test_extending_2(self): def test_extending_2(self):
'''
This test fails in DebugMode for the same reasons the test in
tensor/tests/test_basic.py:T_scalarfromtensor.test0
fails on debug mode ( as much as I could tell - Razvan )
'''
from theano import gof from theano import gof
class Double(gof.Type): class Double(gof.Type):
...@@ -699,6 +706,8 @@ class T_loading_and_saving(unittest.TestCase): ...@@ -699,6 +706,8 @@ class T_loading_and_saving(unittest.TestCase):
my_obj = theano.function([theano.In(x, borrow=True)] my_obj = theano.function([theano.In(x, borrow=True)]
, theano.Out(y, borrow=True)) , theano.Out(y, borrow=True))
mode_instance = theano.compile.mode.get_mode(None)
if not isinstance(mode_instance, theano.compile.debugmode.DebugMode):
f = file('obj.save', 'wb') f = file('obj.save', 'wb')
cPickle.dump(my_obj, f, protocol=cPickle.HIGHEST_PROTOCOL) cPickle.dump(my_obj, f, protocol=cPickle.HIGHEST_PROTOCOL)
f.close() f.close()
...@@ -754,8 +763,8 @@ class T_using_gpu(unittest.TestCase): ...@@ -754,8 +763,8 @@ class T_using_gpu(unittest.TestCase):
import numpy import numpy
import time import time
vlen = 10 * 30 * 768 # 10 x #cores x # threads per core vlen = 10 * 30 * 70 # 10 x #cores x # threads per core
iters = 1000 iters = 10
rng = numpy.random.RandomState(22) rng = numpy.random.RandomState(22)
x = shared(numpy.asarray(rng.rand(vlen), config.floatX)) x = shared(numpy.asarray(rng.rand(vlen), config.floatX))
...@@ -782,8 +791,8 @@ class T_using_gpu(unittest.TestCase): ...@@ -782,8 +791,8 @@ class T_using_gpu(unittest.TestCase):
import numpy import numpy
import time import time
vlen = 10 * 30 * 768 # 10 x #cores x # threads per core vlen = 10 * 30 * 70 # 10 x #cores x # threads per core
iters = 1000 iters = 10
rng = numpy.random.RandomState(22) rng = numpy.random.RandomState(22)
x = shared(numpy.asarray(rng.rand(vlen), config.floatX)) x = shared(numpy.asarray(rng.rand(vlen), config.floatX))
...@@ -811,8 +820,8 @@ class T_using_gpu(unittest.TestCase): ...@@ -811,8 +820,8 @@ class T_using_gpu(unittest.TestCase):
import numpy import numpy
import time import time
vlen = 10 * 30 * 768 # 10 x #cores x # threads per core vlen = 10 * 30 * 70 # 10 x #cores x # threads per core
iters = 1000 iters = 10
rng = numpy.random.RandomState(22) rng = numpy.random.RandomState(22)
x = shared(numpy.asarray(rng.rand(vlen), config.floatX)) x = shared(numpy.asarray(rng.rand(vlen), config.floatX))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论