提交 4e2127a4 authored 作者: Frederic's avatar Frederic

Add comment to tell to don't use the old neighbourhoods.py version and point to the new ones.

Also make sure the input is on the CPU, so a transfer is added when needed.
上级 a47d605f
#!/usr/bin/python #!/usr/bin/python
"""WARNING: This code is not recommanded. It is not finished, it is
slower then the version in sandbox/neighbours.py, and it do not work
on the GPU.
We only keep this version here as it is a little bit more generic, so
it cover more cases. But thoses cases aren't needed frequently, so you
probably don't want to use this version, go see neighbours.py!!!!!!!
"""
import theano import theano
from theano import gof, Op, tensor, Variable, Apply from theano import gof, Op, tensor, Variable, Apply
...@@ -150,6 +158,7 @@ class NeighbourhoodsFromImages(Op): ...@@ -150,6 +158,7 @@ class NeighbourhoodsFromImages(Op):
return out_dims, num_strides return out_dims, num_strides
def make_node(self, x): def make_node(self, x):
x = theano.tensor.as_tensor_variable(x)
if self.inverse: if self.inverse:
# +1 in the inverse case # +1 in the inverse case
if x.type.ndim != (self.n_dims_before + \ if x.type.ndim != (self.n_dims_before + \
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论