提交 4045cc48 authored 作者: Ian Goodfellow's avatar Ian Goodfellow

merged

......@@ -520,8 +520,14 @@ class Function(object):
allow_downcast=s.allow_downcast)
except Exception, e:
e.args = tuple(list(e.args)+["Bad input argument at index %d" % i])
function_name="theano function"
if self.name:
function_name += 'with name "'+self.name+'" '
#end if
e.args = tuple(list(e.args)+["Bad input argument to "+function_name+" at index %d" % i])
raise
#end except
#end if
s.provided += 1
i+=1
......
......@@ -9,7 +9,7 @@ _logger = logging.getLogger('theano.tensor.opt')
import operator
import itertools
import sys
import traceback
import numpy
import numpy as N #guys... please don't do this in the library :(
......@@ -716,9 +716,9 @@ class ShapeFeature(object):
except NotImplementedError:
o_shapes = self.default_infer_shape(node, [self.shape_of[r] for r in node.inputs])
except Exception, e:
_logger.error('Failed to infer_shape from Op %s (i_shapes=%s): %s %s'% (node.op,
_logger.error('Failed to infer_shape from Op %s.\nInput shapes:%s\nException encountered during infer_shape: %s\nException message: %s\nTraceback: %s'% (node.op,
[self.shape_of[r] for r in node.inputs],
type(e), str(e)))
type(e), str(e), traceback.format_exc()))
o_shapes = self.default_infer_shape(node, [self.shape_of[r] for r in node.inputs])
# this is packed information
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论