提交 5d2cdfb8 authored 作者: Frederic's avatar Frederic

Don't access directly the .val value direction of config value as they are not lazyly evaluated.

上级 c5f3a701
...@@ -126,9 +126,7 @@ def _config_print(thing, buf): ...@@ -126,9 +126,7 @@ def _config_print(thing, buf):
for cv in _config_var_list: for cv in _config_var_list:
print >> buf, cv print >> buf, cv
print >> buf, " Doc: ", cv.doc print >> buf, " Doc: ", cv.doc
if not hasattr(cv, 'val'): print >> buf, " Value: ", cv.__get__()
cv.__get__()
print >> buf, " Value: ", cv.val
print >> buf, "" print >> buf, ""
...@@ -142,11 +140,8 @@ def get_config_md5(): ...@@ -142,11 +140,8 @@ def get_config_md5():
""" """
all_opts = sorted([c for c in _config_var_list if c.in_c_key], all_opts = sorted([c for c in _config_var_list if c.in_c_key],
key=lambda cv: cv.fullname) key=lambda cv: cv.fullname)
for opt in all_opts:
if not hasattr(opt, 'val'):
opt.__get__()
return theano.gof.cc.hash_from_code('\n'.join( return theano.gof.cc.hash_from_code('\n'.join(
['%s = %s' % (cv.fullname, cv.val) for cv in all_opts])) ['%s = %s' % (cv.fullname, cv.__get__()) for cv in all_opts]))
class TheanoConfigParser(object): class TheanoConfigParser(object):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论