提交 1af7476e authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Fixes in conv3d2d for python 2.4

上级 c2d3f2f6
import theano import theano
from theano.compat import any
from theano.gradient import DisconnectedType from theano.gradient import DisconnectedType
from theano.gof import Op, Apply from theano.gof import Op, Apply
from theano import tensor from theano import tensor
...@@ -11,7 +12,10 @@ def get_diagonal_subtensor_view(x, i0, i1): ...@@ -11,7 +12,10 @@ def get_diagonal_subtensor_view(x, i0, i1):
:note: it return a partial view of x, not a partial copy. :note: it return a partial view of x, not a partial copy.
""" """
# We have to cast i0 and i0 to int because python 2.4 (and maybe later)
# do not support indexing with 0-dim, 'int*' ndarrays.
i0 = int(i0)
i1 = int(i1)
if x.shape[i0] < x.shape[i1]: if x.shape[i0] < x.shape[i1]:
raise NotImplementedError('is this allowed?') raise NotImplementedError('is this allowed?')
idx = [slice(None)] * x.ndim idx = [slice(None)] * x.ndim
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论