Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
4445335c
提交
4445335c
authored
7月 14, 2014
作者:
Hengjean
提交者:
Frederic
10月 21, 2014
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added verifications and fixed bug.
上级
de0549e5
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
10 行增加
和
3 行删除
+10
-3
function_module.py
theano/compile/function_module.py
+10
-3
没有找到文件。
theano/compile/function_module.py
浏览文件 @
4445335c
...
@@ -1136,6 +1136,13 @@ class FunctionMaker(object):
...
@@ -1136,6 +1136,13 @@ class FunctionMaker(object):
input_new
,
input_old
in
zip
(
inputs_new
,
inputs_old
)):
input_new
,
input_old
in
zip
(
inputs_new
,
inputs_old
)):
print
'need to optimize, because inputs are of different types'
print
'need to optimize, because inputs are of different types'
continue
continue
elif
not
all
(
ouput_new
.
type
==
output_old
.
type
for
output_new
,
output_old
in
zip
(
outputs_new
,
outputs_old
)):
print
'need to optimize, because outputs are of different types'
continue
elif
not
len
(
fgraph
.
apply_node
)
==
len
(
output_new
.
fgraph
.
apply_node
):
print
'need to optimize, because numbers of nodes in graph are different'
continue
else
:
else
:
# when the both inputs are of the same size
# when the both inputs are of the same size
givens
=
dict
(
zip
(
inputs_new
,
inputs_old
))
givens
=
dict
(
zip
(
inputs_new
,
inputs_old
))
...
@@ -1151,15 +1158,15 @@ class FunctionMaker(object):
...
@@ -1151,15 +1158,15 @@ class FunctionMaker(object):
'''
'''
# each element indicates if one of the outputs has the same graph
# each element indicates if one of the outputs has the same graph
flags
=
[]
flags
=
[]
for
output_new
,
output_old
in
zip
(
outputs_new
,
outputs_old
):
for
output_new
,
output_old
,
i
in
zip
(
outputs_new
,
outputs_old
,
range
(
len
(
outputs_new
))
):
print
'loop through outputs node for both graphs'
print
'loop through outputs node for both graphs'
f1
=
output_new
.
owner
.
fgraph
.
clone
()
f1
=
output_new
.
owner
.
fgraph
.
clone
()
f2
=
output_old
.
owner
.
fgraph
.
clone
()
f2
=
output_old
.
owner
.
fgraph
.
clone
()
# is_same_graph complains if fgraph is not None
# is_same_graph complains if fgraph is not None
t1
=
f1
.
outputs
[
0
]
t1
=
f1
.
outputs
[
i
]
t2
=
f2
.
outputs
[
0
]
t2
=
f2
.
outputs
[
i
]
def
removeAllFgraph
(
remove
):
def
removeAllFgraph
(
remove
):
if
hasattr
(
remove
,
'fgraph'
):
if
hasattr
(
remove
,
'fgraph'
):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论