Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
0d02e65e
提交
0d02e65e
authored
2月 27, 2013
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more OrderedDict
上级
f4af10da
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
7 行增加
和
7 行删除
+7
-7
scan_utils.py
theano/scan_module/scan_utils.py
+7
-7
没有找到文件。
theano/scan_module/scan_utils.py
浏览文件 @
0d02e65e
...
@@ -492,7 +492,7 @@ class Validator(object):
...
@@ -492,7 +492,7 @@ class Validator(object):
if
invalid
is
None
:
if
invalid
is
None
:
invalid
=
[]
invalid
=
[]
if
valid_equivalent
is
None
:
if
valid_equivalent
is
None
:
valid_equivalent
=
{}
valid_equivalent
=
OrderedDict
()
# Nodes that are valid to have in the graph computing outputs
# Nodes that are valid to have in the graph computing outputs
self
.
valid
=
set
(
valid
)
self
.
valid
=
set
(
valid
)
...
@@ -605,7 +605,7 @@ def compress_outs(op, not_required, inputs):
...
@@ -605,7 +605,7 @@ def compress_outs(op, not_required, inputs):
means removing its inputs from the inner funciton and from the
means removing its inputs from the inner funciton and from the
node inputs, and changing the dictionary.
node inputs, and changing the dictionary.
'''
'''
info
=
{}
info
=
OrderedDict
()
info
[
'tap_array'
]
=
[]
info
[
'tap_array'
]
=
[]
info
[
'n_seqs'
]
=
op
.
info
[
'n_seqs'
]
info
[
'n_seqs'
]
=
op
.
info
[
'n_seqs'
]
info
[
'n_mit_mot'
]
=
0
info
[
'n_mit_mot'
]
=
0
...
@@ -625,7 +625,7 @@ def compress_outs(op, not_required, inputs):
...
@@ -625,7 +625,7 @@ def compress_outs(op, not_required, inputs):
op_inputs
=
op
.
inputs
[:
op
.
n_seqs
]
op_inputs
=
op
.
inputs
[:
op
.
n_seqs
]
op_outputs
=
[]
op_outputs
=
[]
node_inputs
=
inputs
[:
op
.
n_seqs
+
1
]
node_inputs
=
inputs
[:
op
.
n_seqs
+
1
]
map_old_new
=
{}
map_old_new
=
OrderedDict
()
offset
=
0
offset
=
0
ni_offset
=
op
.
n_seqs
+
1
ni_offset
=
op
.
n_seqs
+
1
...
@@ -760,7 +760,7 @@ def reconstruct_graph(inputs, outputs, tag=None):
...
@@ -760,7 +760,7 @@ def reconstruct_graph(inputs, outputs, tag=None):
if
tag
is
None
:
if
tag
is
None
:
tag
=
''
tag
=
''
nw_inputs
=
[
safe_new
(
x
,
tag
)
for
x
in
inputs
]
nw_inputs
=
[
safe_new
(
x
,
tag
)
for
x
in
inputs
]
givens
=
{}
givens
=
OrderedDict
()
for
nw_x
,
x
in
izip
(
nw_inputs
,
inputs
):
for
nw_x
,
x
in
izip
(
nw_inputs
,
inputs
):
givens
[
x
]
=
nw_x
givens
[
x
]
=
nw_x
allinputs
=
theano
.
gof
.
graph
.
inputs
(
outputs
)
allinputs
=
theano
.
gof
.
graph
.
inputs
(
outputs
)
...
@@ -880,7 +880,7 @@ class scan_args(object):
...
@@ -880,7 +880,7 @@ class scan_args(object):
p
+=
n_shared_outs
p
+=
n_shared_outs
q
+=
n_shared_outs
q
+=
n_shared_outs
self
.
other_info
=
d
ict
()
self
.
other_info
=
OrderedD
ict
()
for
k
in
(
'truncate_gradient'
,
'name'
,
'mode'
,
'destroy_map'
,
for
k
in
(
'truncate_gradient'
,
'name'
,
'mode'
,
'destroy_map'
,
'gpu'
,
'as_while'
,
'profile'
):
'gpu'
,
'as_while'
,
'profile'
):
if
k
in
info
:
if
k
in
info
:
...
@@ -914,7 +914,7 @@ class scan_args(object):
...
@@ -914,7 +914,7 @@ class scan_args(object):
self
.
outer_out_nit_sot
+
self
.
outer_out_nit_sot
+
self
.
outer_out_shared
))
self
.
outer_out_shared
))
info
=
property
(
lambda
self
:
d
ict
(
info
=
property
(
lambda
self
:
OrderedD
ict
(
n_seqs
=
len
(
self
.
outer_in_seqs
),
n_seqs
=
len
(
self
.
outer_in_seqs
),
n_mit_mot
=
len
(
self
.
outer_in_mit_mot
),
n_mit_mot
=
len
(
self
.
outer_in_mit_mot
),
n_mit_sot
=
len
(
self
.
outer_in_mit_sot
),
n_mit_sot
=
len
(
self
.
outer_in_mit_sot
),
...
@@ -979,4 +979,4 @@ def forced_replace(out, x, y):
...
@@ -979,4 +979,4 @@ def forced_replace(out, x, y):
rval
+=
traverse
(
inp
,
x
)
rval
+=
traverse
(
inp
,
x
)
return
rval
return
rval
to_replace
=
traverse
(
out
,
x
)
to_replace
=
traverse
(
out
,
x
)
return
clone
(
out
,
replace
=
d
ict
((
v
,
y
)
for
v
in
to_replace
))
return
clone
(
out
,
replace
=
OrderedD
ict
((
v
,
y
)
for
v
in
to_replace
))
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论