Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
5ceb373d
提交
5ceb373d
authored
2月 27, 2013
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more OrderedDict.
上级
0d02e65e
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
11 行增加
和
11 行删除
+11
-11
scan_op.py
theano/scan_module/scan_op.py
+11
-11
没有找到文件。
theano/scan_module/scan_op.py
浏览文件 @
5ceb373d
...
...
@@ -23,7 +23,7 @@ import theano
from
theano.compile
import
function
,
Param
,
Out
from
theano
import
compile
from
theano
import
gradient
from
theano.gof.python25
import
any
from
theano.gof.python25
import
any
,
OrderedDict
from
theano.gof
import
PureOp
,
Apply
from
theano
import
gof
from
theano.tensor
import
TensorType
...
...
@@ -426,9 +426,9 @@ class Scan(PureOp):
if
not
type
(
self
)
==
type
(
other
):
return
False
if
not
'destroy_map'
in
self
.
info
:
self
.
info
[
'destroy_map'
]
=
{}
self
.
info
[
'destroy_map'
]
=
OrderedDict
()
if
not
'destroy_map'
in
other
.
info
:
other
.
info
[
'destroy_map'
]
=
{}
other
.
info
[
'destroy_map'
]
=
OrderedDict
()
keys_to_check
=
[
'truncate_gradient'
,
'profile'
,
'n_seqs'
,
'tap_array'
,
'name'
,
'as_while'
,
'n_mit_sot'
,
'destroy_map'
,
...
...
@@ -472,7 +472,7 @@ class Scan(PureOp):
name
=
'for'
aux_txt
=
'
%
s'
if
getattr
(
self
,
'destroy_map'
,
None
)
is
None
:
self
.
destroy_map
=
{}
self
.
destroy_map
=
OrderedDict
()
if
len
(
self
.
destroy_map
.
keys
())
>
0
:
# Check if all outputs are inplace
if
(
sorted
(
self
.
destroy_map
.
keys
())
==
\
...
...
@@ -852,7 +852,7 @@ class Scan(PureOp):
pos
=
[(
-
self
.
mintaps
[
idx
])
%
store_steps
[
idx
]
for
idx
in
xrange
(
self
.
n_outs
+
self
.
n_nit_sot
)]
if
not
getattr
(
self
,
'destroy_map'
,
None
):
self
.
destroy_map
=
{}
self
.
destroy_map
=
OrderedDict
()
# 2.1 Create storage space for outputs
for
idx
in
xrange
(
self
.
n_outs
):
if
idx
in
self
.
destroy_map
:
...
...
@@ -1138,7 +1138,7 @@ class Scan(PureOp):
# Non-sequences have a direct equivalent from self.inputs in
# node.inputs
inner_non_sequences
=
self
.
inputs
[
len
(
seqs_shape
)
+
len
(
outs_shape
):]
out_equivalent
=
{}
out_equivalent
=
OrderedDict
()
for
in_ns
,
out_ns
in
izip
(
inner_non_sequences
,
node
.
inputs
[
offset
:]):
out_equivalent
[
in_ns
]
=
out_ns
if
self
.
as_while
:
...
...
@@ -1257,7 +1257,7 @@ class Scan(PureOp):
def
compute_gradient
(
y
,
g_y
,
diff_inputs
):
rval
=
[]
gmp
=
{}
gmp
=
OrderedDict
()
consider_inps
=
[
x
for
x
in
theano
.
gof
.
graph
.
inputs
([
y
])
if
x
in
diff_inputs
]
for
x
in
consider_inps
:
...
...
@@ -1695,7 +1695,7 @@ class Scan(PureOp):
new_tap_array
=
mitmot_inp_taps
+
[[
-
1
]
for
k
in
xrange
(
n_sitsot_outs
)]
info
=
{}
info
=
OrderedDict
()
info
[
'n_seqs'
]
=
len
(
outer_inp_seqs
)
info
[
'n_mit_sot'
]
=
0
info
[
'tap_array'
]
=
new_tap_array
...
...
@@ -1709,7 +1709,7 @@ class Scan(PureOp):
info
[
'n_nit_sot'
]
=
n_nit_sot
info
[
'as_while'
]
=
False
info
[
'profile'
]
=
self
.
profile
info
[
'destroy_map'
]
=
{}
info
[
'destroy_map'
]
=
OrderedDict
()
if
self
.
name
:
info
[
'name'
]
=
'grad_of_'
+
self
.
name
else
:
...
...
@@ -1852,7 +1852,7 @@ class Scan(PureOp):
# The only exception is the eval point for the number of sequences, and
# evan point for the number of nit_sot which I think should just be
# ignored (?)
info
=
{}
info
=
OrderedDict
()
info
[
'n_seqs'
]
=
self
.
n_seqs
*
2
info
[
'n_mit_sot'
]
=
self
.
n_mit_sot
*
2
info
[
'n_sit_sot'
]
=
self
.
n_sit_sot
*
2
...
...
@@ -1869,7 +1869,7 @@ class Scan(PureOp):
info
[
'name'
]
=
None
info
[
'mode'
]
=
self
.
mode
info
[
'mit_mot_out_slices'
]
=
self
.
mit_mot_out_slices
*
2
info
[
'destroy_map'
]
=
{}
info
[
'destroy_map'
]
=
OrderedDict
()
new_tap_array
=
[]
b
=
0
e
=
self
.
n_mit_mot
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论