提交 f38b603c authored 作者: Simon Lemieux's avatar Simon Lemieux

modified dimensions in test_neighbours.py

上级 3662b679
...@@ -5,18 +5,19 @@ import theano.tensor as T ...@@ -5,18 +5,19 @@ import theano.tensor as T
from neighbours import images2neibs, neibs2images from neighbours import images2neibs, neibs2images
def neibs_test(): def neibs_test():
images = shared(arange(2*2*4*4, dtype='float32').reshape(2,2,4,4)) shape = (100,40,18,18)
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))
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))
print g() #print g()
assert allclose(images.value,g()) assert allclose(images.value,g())
neibs_test() neibs_test()
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论