提交 35ff6f6a authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Fixes related to the new usage of ShapeError instead of NotImplementedError

上级 61493b72
......@@ -4,6 +4,7 @@ This is not used currently very used. It appear in some case, but I'm not sure i
It could help the current system to make it detect problem earlier when contructing the graph instead of during optimization.
"""
import sys
import theano
from theano import gof
def ishape(v):
......@@ -35,7 +36,7 @@ class Apply(gof.Apply):
try:
oshapes = infer_shape(self, ishapes)
except NotImplementedError:
except theano.tensor.opt.ShapeError:
return
for o, oshp in zip(outputs, oshapes):
......
......@@ -575,14 +575,15 @@ class ConvOp(Op):
try:
fmshp = ConvOp.getOutputShape(imshp[1:], kshp, (self.dx,self.dy), self.out_mode)
except TypeError:
raise NotImplementedError()
raise theano.tensor.opt.ShapeError()
outshp = (batch_size,fmo) + tuple(fmshp)
return [outshp]
else:
# Haven't implemented this case. imshp and kshp may be symbollic
# and ConvOp.getOutputShape doesn't handle this. In this case
# we simply let the default function do its work.
raise NotImplementedError()
raise theano.tensor.opt.ShapeError()
def perform(self,node, inp, out):
"""
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论