Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
2efb1167
提交
2efb1167
authored
2月 09, 2011
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
If DebugMode receive a specific linker, raise an error at it can only use its own linker.
updated Doc and the handling of theano flags to don't pass him one linker.
上级
4d263eb0
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
10 行增加
和
5 行删除
+10
-5
debugmode.py
theano/compile/debugmode.py
+3
-0
mode.py
theano/compile/mode.py
+5
-2
configdefaults.py
theano/configdefaults.py
+2
-3
没有找到文件。
theano/compile/debugmode.py
浏览文件 @
2efb1167
...
@@ -1674,6 +1674,9 @@ class DebugMode(Mode):
...
@@ -1674,6 +1674,9 @@ class DebugMode(Mode):
If any of these arguments (except optimizer) is not None, it overrides the class default.
If any of these arguments (except optimizer) is not None, it overrides the class default.
The linker arguments is not used. It is set their to allow Mode.requiring() and some other fct to work with DebugMode too.
The linker arguments is not used. It is set their to allow Mode.requiring() and some other fct to work with DebugMode too.
"""
"""
if
linker
is
not
None
and
not
isinstance
(
linker
,
_Linker
):
raise
Exception
(
"DebugMode can use only its own linker! Don't give him one to use it."
)
super
(
DebugMode
,
self
)
.
__init__
(
super
(
DebugMode
,
self
)
.
__init__
(
optimizer
=
optimizer
,
optimizer
=
optimizer
,
linker
=
_Linker
)
linker
=
_Linker
)
...
...
theano/compile/mode.py
浏览文件 @
2efb1167
...
@@ -285,9 +285,12 @@ def get_mode(orig_string):
...
@@ -285,9 +285,12 @@ def get_mode(orig_string):
if
instanciated_default_mode
:
if
instanciated_default_mode
:
return
instanciated_default_mode
return
instanciated_default_mode
#need to import later to break circular dependency.
#need to import later to break circular dependency.
from
profilemode
import
ProfileMode
,
prof_mode_instance_to_print
if
string
==
'DebugMode'
:
from
debugmode
import
DebugMode
from
debugmode
import
DebugMode
#DebugMode use its own linker.
ret
=
eval
(
string
+
'(optimizer=config.optimizer)'
)
else
:
from
profilemode
import
ProfileMode
,
prof_mode_instance_to_print
ret
=
eval
(
string
+
'(linker=config.linker, optimizer=config.optimizer)'
)
ret
=
eval
(
string
+
'(linker=config.linker, optimizer=config.optimizer)'
)
elif
not
predefined_modes
.
has_key
(
string
):
elif
not
predefined_modes
.
has_key
(
string
):
...
...
theano/configdefaults.py
浏览文件 @
2efb1167
...
@@ -49,13 +49,12 @@ try:
...
@@ -49,13 +49,12 @@ try:
subprocess
.
Popen
(
'gcc'
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
subprocess
.
Popen
(
'gcc'
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
# Keep the default linker the same as the one for the mode FAST_RUN
# Keep the default linker the same as the one for the mode FAST_RUN
AddConfigVar
(
'linker'
,
AddConfigVar
(
'linker'
,
"Default linker. If not None, will use this linker with the Mode "
+
"Default linker used if the theano flags mode is Mode or ProfileMode"
,
"object(not ProfileMode or DebugMode)"
,
EnumStr
(
'c|py'
,
'py'
,
'c'
,
'c|py_nogc'
,
'c&py'
))
EnumStr
(
'c|py'
,
'py'
,
'c'
,
'c|py_nogc'
,
'c&py'
))
except
OSError
:
except
OSError
:
# gcc is not present, linker should default to python only
# gcc is not present, linker should default to python only
AddConfigVar
(
'linker'
,
AddConfigVar
(
'linker'
,
"Default linker. If not None, will use this linker with the Mode object(not ProfileMode or DebugMode)
"
,
"Default linker used if the theano flags mode is Mode or ProfileMode
"
,
EnumStr
(
'py'
,
'c|py'
,
'c'
,
'c|py_nogc'
,
'c&py'
))
EnumStr
(
'py'
,
'c|py'
,
'c'
,
'c|py_nogc'
,
'c&py'
))
warning
(
'GCC not detected ! Theano will be unable to execute optimized '
+
warning
(
'GCC not detected ! Theano will be unable to execute optimized '
+
'C-implementations (for both CPU and GPU) and will default to '
+
'C-implementations (for both CPU and GPU) and will default to '
+
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论