提交 8c6975e2 authored 作者: Frederic Bastien's avatar Frederic Bastien

fix tests in FAST_COMPILE

上级 a7e855b6
...@@ -4,18 +4,22 @@ from theano import shared, function ...@@ -4,18 +4,22 @@ from theano import shared, function
import theano.tensor as T import theano.tensor as T
from neighbours import images2neibs, neibs2images from neighbours import images2neibs, neibs2images
mode = theano.config.mode
if mode=="FAST_COMPILE":
mode='FAST_RUN'
def neibs_test(): def neibs_test():
shape = (100,40,18,18) shape = (100,40,18,18)
images = shared(arange(prod(shape), dtype='float32').reshape(shape)) images = shared(arange(prod(shape), dtype='float32').reshape(shape))
neib_shape = T.as_tensor_variable((2,2))#(array((2,2), dtype='float32')) neib_shape = T.as_tensor_variable((2,2))#(array((2,2), dtype='float32'))
f = function([], images2neibs(images, neib_shape)) f = function([], images2neibs(images, neib_shape), mode=mode)
#print images.value #print images.value
neibs = f() neibs = f()
#print neibs #print neibs
g = function([], neibs2images(neibs, neib_shape, images.shape)) g = function([], neibs2images(neibs, neib_shape, images.shape), mode=mode)
#print g() #print g()
assert allclose(images.value,g()) assert allclose(images.value,g())
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论