提交 cb32d5ba authored 作者: Frederic Bastien's avatar Frederic Bastien

added speed test for Images2Neibs in mode wrap_centered

上级 5b989fa1
...@@ -303,7 +303,7 @@ def test_neibs_gpu(): ...@@ -303,7 +303,7 @@ def test_neibs_gpu():
def speed_neibs(): def speed_neibs():
shape = (100,40,18,18) shape = (100,40,18,18)
images = shared(numpy.arange(numpy.prod(shape), dtype='float32').reshape(shape)) images = shared(numpy.arange(numpy.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((3,3))
from theano.sandbox.cuda.basic_ops import gpu_from_host from theano.sandbox.cuda.basic_ops import gpu_from_host
...@@ -311,6 +311,18 @@ def speed_neibs(): ...@@ -311,6 +311,18 @@ def speed_neibs():
for i in range(1000): for i in range(1000):
f() f()
def speed_neibs_wrap_centered():
shape = (100,40,18,18)
images = shared(numpy.arange(numpy.prod(shape), dtype='float32').reshape(shape))
neib_shape = T.as_tensor_variable((3,3))
from theano.sandbox.cuda.basic_ops import gpu_from_host
f = function([], images2neibs(images,neib_shape,mode="wrap_centered"))#, mode=mode_without_gpu)
for i in range(1000):
f()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论