Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
9a11eb68
提交
9a11eb68
authored
7月 13, 2015
作者:
Iban Harlouchet
提交者:
Frederic
7月 22, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
flake8 of theano/gof/unify.py; 3 E left
上级
a2941943
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
8 行增加
和
6 行删除
+8
-6
unify.py
theano/gof/unify.py
+8
-5
test_flake8.py
theano/tests/test_flake8.py
+0
-1
没有找到文件。
theano/gof/unify.py
浏览文件 @
9a11eb68
...
@@ -35,10 +35,12 @@ class Variable:
...
@@ -35,10 +35,12 @@ class Variable:
"""
"""
def
__init__
(
self
,
name
=
"?"
):
def
__init__
(
self
,
name
=
"?"
):
self
.
name
=
name
self
.
name
=
name
def
__str__
(
self
):
def
__str__
(
self
):
return
(
self
.
__class__
.
__name__
+
"("
+
return
(
self
.
__class__
.
__name__
+
"("
+
", "
.
join
(
"
%
s=
%
s"
%
(
key
,
value
)
", "
.
join
(
"
%
s=
%
s"
%
(
key
,
value
)
for
key
,
value
in
iteritems
(
self
.
__dict__
))
+
")"
)
for
key
,
value
in
iteritems
(
self
.
__dict__
))
+
")"
)
def
__repr__
(
self
):
def
__repr__
(
self
):
return
str
(
self
)
return
str
(
self
)
...
@@ -348,8 +350,9 @@ def unify_walk(a, b, U):
...
@@ -348,8 +350,9 @@ def unify_walk(a, b, U):
Checks for the existence of the __unify_walk__ method for one of
Checks for the existence of the __unify_walk__ method for one of
the objects.
the objects.
"""
"""
if
not
isinstance
(
a
,
Variable
)
and
not
isinstance
(
b
,
Variable
)
\
if
(
not
isinstance
(
a
,
Variable
)
and
and
hasattr
(
a
,
"__unify_walk__"
):
not
isinstance
(
b
,
Variable
)
and
hasattr
(
a
,
"__unify_walk__"
)):
return
a
.
__unify_walk__
(
b
,
U
)
return
a
.
__unify_walk__
(
b
,
U
)
else
:
else
:
return
FALL_THROUGH
return
FALL_THROUGH
...
@@ -430,8 +433,9 @@ def unify_merge(vs, o, U):
...
@@ -430,8 +433,9 @@ def unify_merge(vs, o, U):
@comm_guard
(
ANY_TYPE
,
ANY_TYPE
)
@comm_guard
(
ANY_TYPE
,
ANY_TYPE
)
def
unify_merge
(
a
,
b
,
U
):
def
unify_merge
(
a
,
b
,
U
):
if
not
isinstance
(
a
,
Variable
)
and
not
isinstance
(
b
,
Variable
)
\
if
(
not
isinstance
(
a
,
Variable
)
and
and
hasattr
(
a
,
"__unify_merge__"
):
not
isinstance
(
b
,
Variable
)
and
hasattr
(
a
,
"__unify_merge__"
)):
return
a
.
__unify_merge__
(
b
,
U
)
return
a
.
__unify_merge__
(
b
,
U
)
else
:
else
:
return
FALL_THROUGH
return
FALL_THROUGH
...
@@ -502,4 +506,3 @@ if __name__ == "__main__":
...
@@ -502,4 +506,3 @@ if __name__ == "__main__":
U
=
unify_walk
((
1
,
2
),
(
va
,
va
),
Unification
())
U
=
unify_walk
((
1
,
2
),
(
va
,
va
),
Unification
())
print
(
U
[
va
])
print
(
U
[
va
])
theano/tests/test_flake8.py
浏览文件 @
9a11eb68
...
@@ -223,7 +223,6 @@ whitelist_flake8 = [
...
@@ -223,7 +223,6 @@ whitelist_flake8 = [
"sparse/sandbox/sp2.py"
,
"sparse/sandbox/sp2.py"
,
"sparse/sandbox/truedot.py"
,
"sparse/sandbox/truedot.py"
,
"sparse/sandbox/sp.py"
,
"sparse/sandbox/sp.py"
,
"gof/unify.py"
,
"gof/__init__.py"
,
"gof/__init__.py"
,
"gof/tests/test_cmodule.py"
,
"gof/tests/test_cmodule.py"
,
"gof/tests/test_destroyhandler.py"
,
"gof/tests/test_destroyhandler.py"
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论