提交 c8bd9897 authored 作者: goodfeli's avatar goodfeli

Merge pull request #1 from delallea/add_verbosity_config

Add verbosity config
......@@ -486,6 +486,8 @@ import theano and print the config variable, as in:
with short names such as ``'Elemwise{add_no_inplace}'``. If ``'high'``,
some exceptions will also refer to apply nodes with long descriptions like:
A. Elemwise{add_no_inplace}
B. log_likelihood_v_given_h
C. log_likelihood_h
::
A. Elemwise{add_no_inplace}
B. log_likelihood_v_given_h
C. log_likelihood_h
......@@ -2495,11 +2495,12 @@ class Alloc(gof.Op):
for i, s in enumerate(sh):
if s.type.dtype[:3] not in ('int', 'uin'):
if config.exception_verbosity == 'high':
raise TypeError('Shape arguments to Alloc must be integers,' + \
'but argument '+str(i)+' is not for apply node: '+\
min_informative_str(s))
s_as_str = '\n' + min_informative_str(s)
else:
raise TypeError('Shape arguments must be integers', s)
s_as_str = str(s)
raise TypeError('Shape arguments to Alloc must be integers, '
'but argument %s is not for apply node: %s' %
(i, s_as_str))
# if s is constant 1, then we're broadcastable in that dim
try:
const_shp = get_constant_value(s)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论