Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
2a1aa262
提交
2a1aa262
authored
5月 22, 2015
作者:
Arnaud Bergeron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Flake8 for compile/mode.py
上级
b5263298
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
14 行增加
和
15 行删除
+14
-15
mode.py
theano/compile/mode.py
+14
-14
test_flake8.py
theano/tests/test_flake8.py
+0
-1
没有找到文件。
theano/compile/mode.py
浏览文件 @
2a1aa262
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
"""
"""
from
__future__
import
print_function
from
__future__
import
print_function
import
logging
import
logging
import
warnings
from
textwrap
import
dedent
import
numpy
import
numpy
...
@@ -11,24 +9,24 @@ import theano
...
@@ -11,24 +9,24 @@ import theano
from
theano
import
gof
from
theano
import
gof
import
theano.gof.vm
import
theano.gof.vm
from
theano.configparser
import
config
,
AddConfigVar
,
StrParam
from
theano.configparser
import
config
,
AddConfigVar
,
StrParam
from
theano.compile.ops
import
register_view_op_c_code
,
_output_guard
from
theano.compile.ops
import
_output_guard
_logger
=
logging
.
getLogger
(
'theano.compile.mode'
)
_logger
=
logging
.
getLogger
(
'theano.compile.mode'
)
AddConfigVar
(
'optimizer_excluding'
,
AddConfigVar
(
'optimizer_excluding'
,
(
"When using the default mode, we will remove optimizer with these
"
(
"When using the default mode, we will remove optimizer with
"
"
tags. Separate tags with ':'."
),
"these
tags. Separate tags with ':'."
),
StrParam
(
""
,
allow_override
=
False
),
StrParam
(
""
,
allow_override
=
False
),
in_c_key
=
False
)
in_c_key
=
False
)
AddConfigVar
(
'optimizer_including'
,
AddConfigVar
(
'optimizer_including'
,
(
"When using the default mode, we will add optimizer with these tags.
"
(
"When using the default mode, we will add optimizer with
"
"
Separate tags with ':'."
),
"these tags.
Separate tags with ':'."
),
StrParam
(
""
,
allow_override
=
False
),
StrParam
(
""
,
allow_override
=
False
),
in_c_key
=
False
)
in_c_key
=
False
)
AddConfigVar
(
'optimizer_requiring'
,
AddConfigVar
(
'optimizer_requiring'
,
(
"When using the default mode, we will require optimizer with these
"
(
"When using the default mode, we will require optimizer with
"
"
tags. Separate tags with ':'."
),
"these
tags. Separate tags with ':'."
),
StrParam
(
""
,
allow_override
=
False
),
StrParam
(
""
,
allow_override
=
False
),
in_c_key
=
False
)
in_c_key
=
False
)
...
@@ -287,7 +285,8 @@ class Mode(object):
...
@@ -287,7 +285,8 @@ class Mode(object):
def
__str__
(
self
):
def
__str__
(
self
):
return
"
%
s(linker =
%
s, optimizer =
%
s)"
%
(
self
.
__class__
.
__name__
,
return
"
%
s(linker =
%
s, optimizer =
%
s)"
%
(
self
.
__class__
.
__name__
,
self
.
provided_linker
,
self
.
provided_optimizer
)
self
.
provided_linker
,
self
.
provided_optimizer
)
def
__get_optimizer
(
self
):
def
__get_optimizer
(
self
):
if
isinstance
(
self
.
_optimizer
,
gof
.
Query
):
if
isinstance
(
self
.
_optimizer
,
gof
.
Query
):
...
@@ -364,10 +363,11 @@ def get_mode(orig_string):
...
@@ -364,10 +363,11 @@ def get_mode(orig_string):
# DebugMode use its own linker.
# DebugMode use its own linker.
ret
=
DebugMode
(
optimizer
=
config
.
optimizer
)
ret
=
DebugMode
(
optimizer
=
config
.
optimizer
)
else
:
else
:
# The import is needed in case string is ProfileMode
# This might be required if the string is 'ProfileMode'
from
profilemode
import
ProfileMode
,
prof_mode_instance_to_print
from
profilemode
import
ProfileMode
# noqa
ret
=
eval
(
string
from
profilemode
import
prof_mode_instance_to_print
+
'(linker=config.linker, optimizer=config.optimizer)'
)
ret
=
eval
(
string
+
'(linker=config.linker, optimizer=config.optimizer)'
)
elif
string
in
predefined_modes
:
elif
string
in
predefined_modes
:
ret
=
predefined_modes
[
string
]
ret
=
predefined_modes
[
string
]
else
:
else
:
...
...
theano/tests/test_flake8.py
浏览文件 @
2a1aa262
...
@@ -38,7 +38,6 @@ whitelist_flake8 = [
...
@@ -38,7 +38,6 @@ whitelist_flake8 = [
"tests/test_tutorial.py"
,
"tests/test_tutorial.py"
,
"tests/disturb_mem.py"
,
"tests/disturb_mem.py"
,
"tests/unittest_tools.py"
,
"tests/unittest_tools.py"
,
"compile/mode.py"
,
"compile/profilemode.py"
,
"compile/profilemode.py"
,
"compile/builders.py"
,
"compile/builders.py"
,
"compile/__init__.py"
,
"compile/__init__.py"
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论