Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
020fc625
提交
020fc625
authored
4月 08, 2015
作者:
Mohammad Pezeshki
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
configdefaults.py in pep8
上级
f7a5312c
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
63 行增加
和
41 行删除
+63
-41
configdefaults.py
theano/configdefaults.py
+63
-41
没有找到文件。
theano/configdefaults.py
浏览文件 @
020fc625
...
@@ -24,7 +24,7 @@ def floatX_convert(s):
...
@@ -24,7 +24,7 @@ def floatX_convert(s):
AddConfigVar
(
'floatX'
,
AddConfigVar
(
'floatX'
,
"Default floating-point precision for python casts"
,
"Default floating-point precision for python casts"
,
EnumStr
(
'float64'
,
'float32'
,
convert
=
floatX_convert
,),
EnumStr
(
'float64'
,
'float32'
,
convert
=
floatX_convert
,),
)
)
AddConfigVar
(
'warn_float64'
,
AddConfigVar
(
'warn_float64'
,
"Do an action when a tensor variable with float64 dtype is"
"Do an action when a tensor variable with float64 dtype is"
...
@@ -32,17 +32,17 @@ AddConfigVar('warn_float64',
...
@@ -32,17 +32,17 @@ AddConfigVar('warn_float64',
" gpu back-end and are slow with gamer GPUs."
,
" gpu back-end and are slow with gamer GPUs."
,
EnumStr
(
'ignore'
,
'warn'
,
'raise'
,
'pdb'
),
EnumStr
(
'ignore'
,
'warn'
,
'raise'
,
'pdb'
),
in_c_key
=
False
,
in_c_key
=
False
,
)
)
AddConfigVar
(
'cast_policy'
,
AddConfigVar
(
'cast_policy'
,
"Rules for implicit type casting"
,
'Rules for implicit type casting'
,
EnumStr
(
'custom'
,
'numpy+floatX'
,
EnumStr
(
'custom'
,
'numpy+floatX'
,
# The 'numpy' policy was originally planned to provide a smooth
# The 'numpy' policy was originally planned to provide a
# transition from numpy. It was meant to behave the same as
# smooth transition from numpy. It was meant to behave the
# numpy+floatX, but keeping float64 when numpy would. However
# same asnumpy+floatX, but keeping float64 when numpy
# the current implementation of some cast mechanisms makes i
t
# would. However the current implementation of some cas
t
# a bit more complex to add than what was expected, so it is
# mechanisms makes it a bit more complex to add than what
#
currently not available.
# was expected, so it is
currently not available.
# numpy,
# numpy,
),
),
)
)
...
@@ -82,14 +82,14 @@ class DeviceParam(ConfigParam):
...
@@ -82,14 +82,14 @@ class DeviceParam(ConfigParam):
def
__str__
(
self
):
def
__str__
(
self
):
return
'
%
s (cpu, gpu*, opencl*, cuda*) '
%
(
self
.
fullname
,)
return
'
%
s (cpu, gpu*, opencl*, cuda*) '
%
(
self
.
fullname
,)
AddConfigVar
(
'device'
,
AddConfigVar
(
'device'
,
(
"Default device for computations. If gpu*, change the default to try "
(
"Default device for computations. If gpu*, change the default to try "
"to move computation to it and to put shared variable of float32 "
"to move computation to it and to put shared variable of float32 "
"on it. Do not use upper case letters, only lower case even if "
"on it. Do not use upper case letters, only lower case even if "
"NVIDIA use capital letters."
),
"NVIDIA use capital letters."
),
DeviceParam
(
'cpu'
,
allow_override
=
False
),
DeviceParam
(
'cpu'
,
allow_override
=
False
),
in_c_key
=
False
,
in_c_key
=
False
,)
)
AddConfigVar
(
'gpuarray.init_device'
,
AddConfigVar
(
'gpuarray.init_device'
,
"""
"""
...
@@ -99,7 +99,8 @@ AddConfigVar('gpuarray.init_device',
...
@@ -99,7 +99,8 @@ AddConfigVar('gpuarray.init_device',
StrParam
(
''
),
StrParam
(
''
),
in_c_key
=
False
)
in_c_key
=
False
)
AddConfigVar
(
'init_gpu_device'
,
AddConfigVar
(
'init_gpu_device'
,
(
"Initialize the gpu device to use, works only if device=cpu. "
(
"Initialize the gpu device to use, works only if device=cpu. "
"Unlike 'device', setting this option will NOT move computations, "
"Unlike 'device', setting this option will NOT move computations, "
"nor shared variables, to the specified GPU. "
"nor shared variables, to the specified GPU. "
...
@@ -112,12 +113,14 @@ AddConfigVar('init_gpu_device',
...
@@ -112,12 +113,14 @@ AddConfigVar('init_gpu_device',
allow_override
=
False
),
allow_override
=
False
),
in_c_key
=
False
)
in_c_key
=
False
)
AddConfigVar
(
'force_device'
,
AddConfigVar
(
'force_device'
,
"Raise an error if we can't use the specified device"
,
"Raise an error if we can't use the specified device"
,
BoolParam
(
False
,
allow_override
=
False
),
BoolParam
(
False
,
allow_override
=
False
),
in_c_key
=
False
)
in_c_key
=
False
)
AddConfigVar
(
'print_active_device'
,
AddConfigVar
(
'print_active_device'
,
"Print active device at when the GPU device is initialized."
,
"Print active device at when the GPU device is initialized."
,
BoolParam
(
True
,
allow_override
=
False
),
BoolParam
(
True
,
allow_override
=
False
),
in_c_key
=
False
)
in_c_key
=
False
)
...
@@ -129,7 +132,8 @@ AddConfigVar('print_active_device',
...
@@ -129,7 +132,8 @@ AddConfigVar('print_active_device',
# scalable.
# scalable.
# Also, please be careful not to modify the first item in the enum when adding
# Also, please be careful not to modify the first item in the enum when adding
# new modes, since it is the default mode.
# new modes, since it is the default mode.
AddConfigVar
(
'mode'
,
AddConfigVar
(
'mode'
,
"Default compilation mode"
,
"Default compilation mode"
,
EnumStr
(
'Mode'
,
'ProfileMode'
,
'DebugMode'
,
'FAST_RUN'
,
EnumStr
(
'Mode'
,
'ProfileMode'
,
'DebugMode'
,
'FAST_RUN'
,
'FAST_COMPILE'
,
'PROFILE_MODE'
,
'DEBUG_MODE'
),
'FAST_COMPILE'
,
'PROFILE_MODE'
,
'DEBUG_MODE'
),
...
@@ -209,7 +213,8 @@ AddConfigVar('allow_gc',
...
@@ -209,7 +213,8 @@ AddConfigVar('allow_gc',
in_c_key
=
False
)
in_c_key
=
False
)
# Keep the default optimizer the same as the one for the mode FAST_RUN
# Keep the default optimizer the same as the one for the mode FAST_RUN
AddConfigVar
(
'optimizer'
,
AddConfigVar
(
'optimizer'
,
(
"Default optimizer. If not None, will use this linker with the Mode "
(
"Default optimizer. If not None, will use this linker with the Mode "
"object (not ProfileMode(deprecated) or DebugMode)"
),
"object (not ProfileMode(deprecated) or DebugMode)"
),
EnumStr
(
'fast_run'
,
'merge'
,
'fast_compile'
,
'None'
),
EnumStr
(
'fast_run'
,
'merge'
,
'fast_compile'
,
'None'
),
...
@@ -220,7 +225,8 @@ AddConfigVar('optimizer_verbose',
...
@@ -220,7 +225,8 @@ AddConfigVar('optimizer_verbose',
BoolParam
(
False
),
BoolParam
(
False
),
in_c_key
=
False
)
in_c_key
=
False
)
AddConfigVar
(
'on_opt_error'
,
AddConfigVar
(
'on_opt_error'
,
(
"What to do when an optimization crashes: warn and skip it, raise "
(
"What to do when an optimization crashes: warn and skip it, raise "
"the exception, or fall into the pdb debugger."
),
"the exception, or fall into the pdb debugger."
),
EnumStr
(
'warn'
,
'raise'
,
'pdb'
),
EnumStr
(
'warn'
,
'raise'
,
'pdb'
),
...
@@ -246,13 +252,15 @@ def safe_no_home(home):
...
@@ -246,13 +252,15 @@ def safe_no_home(home):
return
True
return
True
AddConfigVar
(
'home'
,
AddConfigVar
(
'home'
,
"This config option was removed in 0.5: do not use it!"
,
"This config option was removed in 0.5: do not use it!"
,
ConfigParam
(
''
,
allow_override
=
False
,
filter
=
safe_no_home
),
ConfigParam
(
''
,
allow_override
=
False
,
filter
=
safe_no_home
),
in_c_key
=
False
)
in_c_key
=
False
)
AddConfigVar
(
'nocleanup'
,
AddConfigVar
(
'nocleanup'
,
"Suppress the deletion of code files that did not compile cleanly"
,
"Suppress the deletion of code files that did not compile cleanly"
,
BoolParam
(
False
),
BoolParam
(
False
),
in_c_key
=
False
)
in_c_key
=
False
)
...
@@ -267,38 +275,44 @@ AddConfigVar('on_unused_input',
...
@@ -267,38 +275,44 @@ AddConfigVar('on_unused_input',
# So changing it after import will not modify these global variables.
# So changing it after import will not modify these global variables.
# This could be done differently... but for now we simply prevent it from being
# This could be done differently... but for now we simply prevent it from being
# changed at runtime.
# changed at runtime.
AddConfigVar
(
'tensor.cmp_sloppy'
,
AddConfigVar
(
'tensor.cmp_sloppy'
,
"Relax tensor._allclose (0) not at all, (1) a bit, (2) more"
,
"Relax tensor._allclose (0) not at all, (1) a bit, (2) more"
,
IntParam
(
0
,
lambda
i
:
i
in
(
0
,
1
,
2
),
allow_override
=
False
),
IntParam
(
0
,
lambda
i
:
i
in
(
0
,
1
,
2
),
allow_override
=
False
),
in_c_key
=
False
)
in_c_key
=
False
)
AddConfigVar
(
'tensor.local_elemwise_fusion'
,
AddConfigVar
(
'tensor.local_elemwise_fusion'
,
(
"Enable or not in fast_run mode(fast_run optimization) the elemwise "
(
"Enable or not in fast_run mode(fast_run optimization) the elemwise "
"fusion optimization"
),
"fusion optimization"
),
BoolParam
(
True
),
BoolParam
(
True
),
in_c_key
=
False
)
in_c_key
=
False
)
AddConfigVar
(
'gpu.local_elemwise_fusion'
,
AddConfigVar
(
'gpu.local_elemwise_fusion'
,
(
"Enable or not in fast_run mode(fast_run optimization) the gpu "
(
"Enable or not in fast_run mode(fast_run optimization) the gpu "
"elemwise fusion optimization"
),
"elemwise fusion optimization"
),
BoolParam
(
True
),
BoolParam
(
True
),
in_c_key
=
False
)
in_c_key
=
False
)
# http://developer.amd.com/CPU/LIBRARIES/LIBM/Pages/default.aspx
# http://developer.amd.com/CPU/LIBRARIES/LIBM/Pages/default.aspx
AddConfigVar
(
'lib.amdlibm'
,
AddConfigVar
(
'lib.amdlibm'
,
"Use amd's amdlibm numerical library"
,
"Use amd's amdlibm numerical library"
,
BoolParam
(
False
))
BoolParam
(
False
))
AddConfigVar
(
'gpuelemwise.sync'
,
AddConfigVar
(
'gpuelemwise.sync'
,
"when true, wait that the gpu fct finished and check it error code."
,
"when true, wait that the gpu fct finished and check it error code."
,
BoolParam
(
True
),
BoolParam
(
True
),
in_c_key
=
False
)
in_c_key
=
False
)
AddConfigVar
(
'traceback.limit'
,
AddConfigVar
(
'traceback.limit'
,
"The number of stack to trace. -1 mean all."
,
"The number of stack to trace. -1 mean all."
,
# We default to 6 to be able to know where v1 + v2 is created in the
# We default to 6 to be able to know where v1 + v2 is created in the
# user script. The bigger this number is, the more run time it takes.
# user script. The bigger this number is, the more run time it takes.
# We need to default to 7 to support theano.tensor.tensor(...).
# We need to default to 7 to support theano.tensor.tensor(...).
IntParam
(
7
),
IntParam
(
7
),
in_c_key
=
False
)
in_c_key
=
False
)
...
@@ -422,21 +436,24 @@ AddConfigVar('warn.sum_div_dimshuffle_bug',
...
@@ -422,21 +436,24 @@ AddConfigVar('warn.sum_div_dimshuffle_bug',
BoolParam
(
warn_default
(
'0.3'
)),
BoolParam
(
warn_default
(
'0.3'
)),
in_c_key
=
False
)
in_c_key
=
False
)
AddConfigVar
(
'warn.subtensor_merge_bug'
,
AddConfigVar
(
'warn.subtensor_merge_bug'
,
"Warn if previous versions of Theano (before 0.5rc2) could have given "
"Warn if previous versions of Theano (before 0.5rc2) could have given "
"incorrect results when indexing into a subtensor with negative "
"incorrect results when indexing into a subtensor with negative "
"stride (for instance, for instance, x[a:b:-1][c])."
,
"stride (for instance, for instance, x[a:b:-1][c])."
,
BoolParam
(
warn_default
(
'0.5'
)),
BoolParam
(
warn_default
(
'0.5'
)),
in_c_key
=
False
)
in_c_key
=
False
)
AddConfigVar
(
'warn.gpu_set_subtensor1'
,
AddConfigVar
(
'warn.gpu_set_subtensor1'
,
"Warn if previous versions of Theano (before 0.6) could have given "
"Warn if previous versions of Theano (before 0.6) could have given "
"incorrect results when moving to the gpu "
"incorrect results when moving to the gpu "
"set_subtensor(x[int vector], new_value)"
,
"set_subtensor(x[int vector], new_value)"
,
BoolParam
(
warn_default
(
'0.6'
)),
BoolParam
(
warn_default
(
'0.6'
)),
in_c_key
=
False
)
in_c_key
=
False
)
AddConfigVar
(
'warn.vm_gc_bug'
,
AddConfigVar
(
'warn.vm_gc_bug'
,
"There was a bug that existed in the default Theano configuration,"
"There was a bug that existed in the default Theano configuration,"
" only in the development version between July 5th 2012"
" only in the development version between July 5th 2012"
" and July 30th 2012. This was not in a released version."
" and July 30th 2012. This was not in a released version."
...
@@ -474,7 +491,8 @@ AddConfigVar('warn.inc_set_subtensor1',
...
@@ -474,7 +491,8 @@ AddConfigVar('warn.inc_set_subtensor1',
BoolParam
(
warn_default
(
'0.7'
)),
BoolParam
(
warn_default
(
'0.7'
)),
in_c_key
=
False
)
in_c_key
=
False
)
AddConfigVar
(
'compute_test_value'
,
AddConfigVar
(
'compute_test_value'
,
(
"If 'True', Theano will run each op at graph build time, using "
(
"If 'True', Theano will run each op at graph build time, using "
"Constants, SharedVariables and the tag 'test_value' as inputs "
"Constants, SharedVariables and the tag 'test_value' as inputs "
"to the function. This helps the user track down problems in the "
"to the function. This helps the user track down problems in the "
...
@@ -497,7 +515,8 @@ AddConfigVar('unpickle_function',
...
@@ -497,7 +515,8 @@ AddConfigVar('unpickle_function',
BoolParam
(
True
),
BoolParam
(
True
),
in_c_key
=
False
)
in_c_key
=
False
)
AddConfigVar
(
'reoptimize_unpickled_function'
,
AddConfigVar
(
'reoptimize_unpickled_function'
,
"Re-optimize the graph when a theano function is unpickled from the disk."
,
"Re-optimize the graph when a theano function is unpickled from the disk."
,
BoolParam
(
True
,
allow_override
=
True
),
BoolParam
(
True
,
allow_override
=
True
),
in_c_key
=
False
)
in_c_key
=
False
)
...
@@ -509,11 +528,12 @@ AddConfigVar('reoptimize_unpickled_function',
...
@@ -509,11 +528,12 @@ AddConfigVar('reoptimize_unpickled_function',
== 'high', you should include a call to printing.min_informative_str
== 'high', you should include a call to printing.min_informative_str
on all important apply nodes.
on all important apply nodes.
"""
"""
AddConfigVar
(
'exception_verbosity'
,
AddConfigVar
(
"If 'low', the text of exceptions will generally refer "
\
'exception_verbosity'
,
+
"to apply nodes with short names such as "
\
"If 'low', the text of exceptions will generally refer "
+
"Elemwise{add_no_inplace}. If 'high', some exceptions "
\
+
"to apply nodes with short names such as "
+
"will also refer to apply nodes with long descriptions "
\
+
"Elemwise{add_no_inplace}. If 'high', some exceptions "
+
"will also refer to apply nodes with long descriptions "
+
""" like:
+
""" like:
A. Elemwise{add_no_inplace}
A. Elemwise{add_no_inplace}
B. log_likelihood_v_given_h
B. log_likelihood_v_given_h
...
@@ -570,14 +590,16 @@ AddConfigVar('openmp_elemwise_minsize',
...
@@ -570,14 +590,16 @@ AddConfigVar('openmp_elemwise_minsize',
in_c_key
=
False
,
in_c_key
=
False
,
)
)
AddConfigVar
(
'check_input'
,
AddConfigVar
(
'check_input'
,
"Specify if types should check their input in their C code. "
"Specify if types should check their input in their C code. "
"It can be used to speed up compilation, reduce overhead "
"It can be used to speed up compilation, reduce overhead "
"(particularly for scalars) and reduce the number of generated C "
"(particularly for scalars) and reduce the number of generated C "
"files."
,
"files."
,
BoolParam
(
True
))
BoolParam
(
True
))
AddConfigVar
(
'cache_optimizations'
,
AddConfigVar
(
'cache_optimizations'
,
"WARNING: work in progress, does not work yet. "
"WARNING: work in progress, does not work yet. "
"Specify if the optimization cache should be used. This cache will "
"Specify if the optimization cache should be used. This cache will "
"any optimized graph and its optimization. Actually slow downs a lot "
"any optimized graph and its optimization. Actually slow downs a lot "
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论