Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
ac86ad3f
提交
ac86ad3f
authored
8月 04, 2015
作者:
ChienliMa
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
coding style fix
上级
bbf84ee2
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
10 行增加
和
10 行删除
+10
-10
cc.py
theano/gof/cc.py
+2
-2
fg.py
theano/gof/fg.py
+2
-2
link.py
theano/gof/link.py
+6
-6
没有找到文件。
theano/gof/cc.py
浏览文件 @
ac86ad3f
...
@@ -1558,7 +1558,7 @@ class CLinker(link.Linker):
...
@@ -1558,7 +1558,7 @@ class CLinker(link.Linker):
if
(
i
+
len
(
in_storage
))
not
in
dupidx
]
if
(
i
+
len
(
in_storage
))
not
in
dupidx
]
in_storage
=
[
x
for
i
,
x
in
enumerate
(
in_storage
)
if
i
not
in
dupidx
]
in_storage
=
[
x
for
i
,
x
in
enumerate
(
in_storage
)
if
i
not
in
dupidx
]
if
storage_map
is
None
:
if
storage_map
is
None
:
orphd
=
[[
orphan
.
data
]
for
orphan
in
self
.
orphans
]
orphd
=
[[
orphan
.
data
]
for
orphan
in
self
.
orphans
]
else
:
else
:
orphd
=
[
storage_map
[
orphan
]
for
orphan
in
self
.
orphans
]
orphd
=
[
storage_map
[
orphan
]
for
orphan
in
self
.
orphans
]
...
@@ -1719,7 +1719,7 @@ class OpWiseCLinker(link.LocalLinker):
...
@@ -1719,7 +1719,7 @@ class OpWiseCLinker(link.LocalLinker):
return
self
return
self
def
make_all
(
self
,
profiler
=
None
,
input_storage
=
None
,
output_storage
=
None
,
def
make_all
(
self
,
profiler
=
None
,
input_storage
=
None
,
output_storage
=
None
,
storage_map
=
None
):
storage_map
=
None
):
# The lock will be acquired when we compile the first
# The lock will be acquired when we compile the first
# C code. We will keep the lock untill all the function
# C code. We will keep the lock untill all the function
...
...
theano/gof/fg.py
浏览文件 @
ac86ad3f
...
@@ -820,7 +820,7 @@ class FunctionGraph(utils.object2):
...
@@ -820,7 +820,7 @@ class FunctionGraph(utils.object2):
"""Clone the graph and get a memo( a dict )that map old node to new node
"""Clone the graph and get a memo( a dict )that map old node to new node
----------------------------
----------------------------
Parameters:
Parameters:
check_integrity - { bool } Whether to check integrity.
check_integrity - { bool } Whether to check integrity.
Default is True.
Default is True.
attach_feature - { bool } Whether to attach feature of origin graph to
attach_feature - { bool } Whether to attach feature of origin graph to
cloned graph. Default is True.
cloned graph. Default is True.
...
@@ -830,7 +830,7 @@ class FunctionGraph(utils.object2):
...
@@ -830,7 +830,7 @@ class FunctionGraph(utils.object2):
equiv - { dict } A dict that map old node to new node.
equiv - { dict } A dict that map old node to new node.
"""
"""
equiv
=
graph
.
clone_get_equiv
(
self
.
inputs
,
self
.
outputs
)
equiv
=
graph
.
clone_get_equiv
(
self
.
inputs
,
self
.
outputs
)
if
check_integrity
:
if
check_integrity
:
self
.
check_integrity
()
self
.
check_integrity
()
e
=
FunctionGraph
([
equiv
[
i
]
for
i
in
self
.
inputs
],
e
=
FunctionGraph
([
equiv
[
i
]
for
i
in
self
.
inputs
],
...
...
theano/gof/link.py
浏览文件 @
ac86ad3f
...
@@ -551,10 +551,10 @@ def map_storage(fgraph, order, input_storage, output_storage, storage_map=None):
...
@@ -551,10 +551,10 @@ def map_storage(fgraph, order, input_storage, output_storage, storage_map=None):
# add input storage into storage_map
# add input storage into storage_map
for
r
,
storage
in
zip
(
fgraph
.
inputs
,
input_storage
):
for
r
,
storage
in
zip
(
fgraph
.
inputs
,
input_storage
):
if
r
in
storage_map
:
if
r
in
storage_map
:
assert
storage_map
[
r
]
is
storage
,
(
assert
storage_map
[
r
]
is
storage
,
"Given input_storage conflicts with storage in given"
(
"Given input_storage conflicts with storage in given"
"storage_map. Given input_storage: "
,
storage
,
"storage_map. Given input_storage: "
,
storage
,
"Storage in storage_map: "
,
storage_map
[
r
])
"Storage in storage_map: "
,
storage_map
[
r
])
else
:
else
:
storage_map
[
r
]
=
storage
storage_map
[
r
]
=
storage
# for orphan in fgraph.orphans:
# for orphan in fgraph.orphans:
...
@@ -567,8 +567,8 @@ def map_storage(fgraph, order, input_storage, output_storage, storage_map=None):
...
@@ -567,8 +567,8 @@ def map_storage(fgraph, order, input_storage, output_storage, storage_map=None):
assert
len
(
fgraph
.
outputs
)
==
len
(
output_storage
)
assert
len
(
fgraph
.
outputs
)
==
len
(
output_storage
)
for
r
,
storage
in
zip
(
fgraph
.
outputs
,
output_storage
):
for
r
,
storage
in
zip
(
fgraph
.
outputs
,
output_storage
):
if
r
in
storage_map
:
if
r
in
storage_map
:
assert
storage_map
[
r
]
is
storage
,
(
assert
storage_map
[
r
]
is
storage
,
"Given output_storage conflicts with storage in given"
(
"Given output_storage conflicts with storage in given"
"storage_map. Given output_storage: "
,
storage
,
"storage_map. Given output_storage: "
,
storage
,
"Storage in storage_map: "
,
storage_map
[
r
])
"Storage in storage_map: "
,
storage_map
[
r
])
else
:
else
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论