提交 29e7c420 authored 作者: Frederic's avatar Frederic

pep8, typo, better display or err message(\n)

上级 66716e23
......@@ -584,13 +584,15 @@ class Function(object):
# done by raise_with_op is not implemented in C.
if hasattr(self.fn, 'thunks'):
# For the CVM
gof.vm.raise_with_op(self.fn.nodes[self.fn.position_of_error],
self.fn.thunks[self.fn.position_of_error])
gof.vm.raise_with_op(
self.fn.nodes[self.fn.position_of_error],
self.fn.thunks[self.fn.position_of_error])
else:
# For the c linker
# We don't have access from python to all the temps values
# So for now, we just don't print the extra shapes/strides info
gof.vm.raise_with_op(self.fn.nodes[self.fn.position_of_error])
# For the c linker We don't have access from
# python to all the temps values So for now, we
# just don't print the extra shapes/strides info
gof.vm.raise_with_op(
self.fn.nodes[self.fn.position_of_error])
else:
# old-style linkers raise their own exceptions
raise
......
......@@ -13,7 +13,7 @@ __excepthook = sys.excepthook
def log_thunk_trace(value, f=sys.stderr):
"""Log theano's diagnostic stack trace for an exception
"""Log Theano's diagnostic stack trace for an exception
raised by raise_with_op.
"""
# in future, consider accepting `write` as arg rather than file
......@@ -149,7 +149,7 @@ def raise_with_op(node, thunk=None, exc_info=None):
sio = StringIO.StringIO()
traceback.print_list(tr, sio)
tr = sio.getvalue()
detailed_err_msg += "\nBacktrace when the node is created:"
detailed_err_msg += "\nBacktrace when the node is created:\n"
detailed_err_msg += str(tr)
else:
hints.append(
......
......@@ -19,17 +19,18 @@ import theano.gof.cmodule
logger = logging.getLogger(__name__)
AddConfigVar('profile',
"If VM should collect profile information",
BoolParam(False),
in_c_key=False)
"If VM should collect profile information",
BoolParam(False),
in_c_key=False)
AddConfigVar('profile_optimizer',
"If VM should collect optimizer profile information",
BoolParam(False),
in_c_key=False)
"If VM should collect optimizer profile information",
BoolParam(False),
in_c_key=False)
AddConfigVar('profile_memory',
"If VM should collect memory profile information and print it",
BoolParam(False),
in_c_key=False)
"If VM should collect memory profile information and print it",
BoolParam(False),
in_c_key=False)
def filter_vm_lazy(val):
if val == 'False' or val is False:
......@@ -40,7 +41,7 @@ def filter_vm_lazy(val):
return None
else:
raise ValueError('Valid values for an vm.lazy parameter '
'should be None, False or True, not `%s`.' % val)
'should be None, False or True, not `%s`.' % val)
AddConfigVar('vm.lazy',
"Useful only for the vm linkers. When lazy is None,"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论