提交 b1038e91 authored 作者: Frederic Bastien's avatar Frederic Bastien

merge

...@@ -82,9 +82,9 @@ class ProfileMode(Mode): ...@@ -82,9 +82,9 @@ class ProfileMode(Mode):
Their is an hack with the Op-wise summary. Go see it if you want to know more. Their is an hack with the Op-wise summary. Go see it if you want to know more.
param: n_apply_to_print the number of apply to print. Default 15. :param n_apply_to_print: the number of apply to print. Default 15, or n_ops_to_print flag.
param: n_ops_to_print the number of ops to print. Default 20. :param n_ops_to_print: the number of ops to print. Default 20, or n_apply_to_print flag.
""" """
n_ops_to_print=int(get_theano_flag("n_ops_to_print", n_ops_to_print)) n_ops_to_print=int(get_theano_flag("n_ops_to_print", n_ops_to_print))
...@@ -113,11 +113,11 @@ class ProfileMode(Mode): ...@@ -113,11 +113,11 @@ class ProfileMode(Mode):
TODO: Also we don't print the Apply-wise summary as it don't work for now. TODO: Also we don't print the Apply-wise summary as it don't work for now.
TODO: make comparaison with gpu code. TODO: make comparaison with gpu code.
param: other the other instance of ProfileMode that we want to be compared to. :param other: the other instance of ProfileMode that we want to be compared to.
param: n_apply_to_print the number of apply to print. Default 15. :param n_apply_to_print: the number of apply to print. Default 15.
param: n_ops_to_print the number of ops to print. Default 20. :param n_ops_to_print: the number of ops to print. Default 20.
""" """
def diff_dict(a_time,b_time_): def diff_dict(a_time,b_time_):
......
...@@ -371,19 +371,23 @@ def type_guard(type1): ...@@ -371,19 +371,23 @@ def type_guard(type1):
def get_theano_flag(key, default=None): def get_theano_flag(key, default=None):
""" """Return the value for a key passed via the THEANO_FLAGS environment variable.
This function parse the environement variable THEANO_FLAGS.
:type key: a string
:param key: the key to lookup
:type default: any
:param default: the value to be returned if the key is not present. (Default: None)
if the variable don't exist return None if the variable don't exist return `default`
if the key is not in the variable return None if the key is not in the variable return `default`
if the key is in the variable but without a value return True if the key is in the variable but without a value return True
if the key is in the variable with a value return the value if the key is in the variable with a value return the value
if the key appear many times, we return the last value if the key appears many times, we return the last value
the THEANO_FLAGS environement variable is a list of key[=value] that is separated by comma. The THEANO_FLAGS environement variable should be a list of comma-separated key[=value] entries.
""" """
f=os.getenv("THEANO_FLAGS") f=os.getenv("THEANO_FLAGS", "")
ret = default ret = default
key2=key+"=" key2=key+"="
for fl in f.split(','): for fl in f.split(','):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论