Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
c51b2833
提交
c51b2833
authored
2月 26, 2016
作者:
abergeron
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #4129 from nouiz/cleanup
small cleanup, update
上级
04bc006a
2a0c1926
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
24 行增加
和
15 行删除
+24
-15
fg.py
theano/gof/fg.py
+4
-2
scan_op.py
theano/scan_module/scan_op.py
+20
-13
没有找到文件。
theano/gof/fg.py
浏览文件 @
c51b2833
...
@@ -172,8 +172,6 @@ class FunctionGraph(utils.object2):
...
@@ -172,8 +172,6 @@ class FunctionGraph(utils.object2):
for
i
,
output
in
enumerate
(
outputs
):
for
i
,
output
in
enumerate
(
outputs
):
output
.
clients
.
append
((
'output'
,
i
))
output
.
clients
.
append
((
'output'
,
i
))
self
.
node_locks
=
{}
self
.
variable_locks
=
{}
self
.
profile
=
None
self
.
profile
=
None
self
.
update_mapping
=
update_mapping
self
.
update_mapping
=
update_mapping
...
@@ -232,6 +230,8 @@ class FunctionGraph(utils.object2):
...
@@ -232,6 +230,8 @@ class FunctionGraph(utils.object2):
them back to what they were originally.
them back to what they were originally.
"""
"""
for
f
in
self
.
_features
:
self
.
remove_feature
(
f
)
for
apply_node
in
self
.
apply_nodes
:
for
apply_node
in
self
.
apply_nodes
:
del
apply_node
.
fgraph
del
apply_node
.
fgraph
del
apply_node
.
deps
del
apply_node
.
deps
...
@@ -242,6 +242,8 @@ class FunctionGraph(utils.object2):
...
@@ -242,6 +242,8 @@ class FunctionGraph(utils.object2):
self
.
variables
=
set
()
self
.
variables
=
set
()
self
.
inputs
=
None
self
.
inputs
=
None
self
.
outputs
=
None
self
.
outputs
=
None
self
.
profile
=
None
self
.
update_mapping
=
None
# clients #
# clients #
def
clients
(
self
,
r
):
def
clients
(
self
,
r
):
...
...
theano/scan_module/scan_op.py
浏览文件 @
c51b2833
...
@@ -1603,24 +1603,31 @@ class Scan(PureOp):
...
@@ -1603,24 +1603,31 @@ class Scan(PureOp):
# of iterations.
# of iterations.
# sequences
# sequences
seqs_shape
=
[
x
[
1
:]
for
x
in
input_shapes
[
1
:
1
+
self
.
n_seqs
]]
seqs_shape
=
[
x
[
1
:]
for
x
in
input_shapes
[
1
:
1
+
self
.
n_seqs
]]
# inner_seqs = self.inputs[:self.n_seqs]
# We disable extra infer_shape for now. See gh-3765.
# outer_seqs = node.inputs[1:1 + self.n_seqs]
extra_infer_shape
=
False
# for in_s, out_s in izip(inner_seqs, outer_seqs):
# out_equivalent[in_s] = out_s[0]
if
extra_infer_shape
:
inner_seqs
=
self
.
inputs
[:
self
.
n_seqs
]
# mit_mot, mit_sot, sit_sot
outer_seqs
=
node
.
inputs
[
1
:
1
+
self
.
n_seqs
]
# outer_inp_idx = 1 + self.n_seqs
for
in_s
,
out_s
in
izip
(
inner_seqs
,
outer_seqs
):
# inner_inp_idx = self.n_seqs
out_equivalent
[
in_s
]
=
out_s
[
0
]
# mit_mot, mit_sot, sit_sot
outer_inp_idx
=
1
+
self
.
n_seqs
inner_inp_idx
=
self
.
n_seqs
else
:
outer_inp_idx
=
0
n_outs
=
self
.
n_mit_mot
+
self
.
n_mit_sot
+
self
.
n_sit_sot
n_outs
=
self
.
n_mit_mot
+
self
.
n_mit_sot
+
self
.
n_sit_sot
outs_shape
=
[]
outs_shape
=
[]
for
idx
in
xrange
(
n_outs
):
for
idx
in
xrange
(
n_outs
):
#
mintap = abs(min(self.tap_array[idx]))
mintap
=
abs
(
min
(
self
.
tap_array
[
idx
]))
for
k
in
self
.
tap_array
[
idx
]:
for
k
in
self
.
tap_array
[
idx
]:
outs_shape
+=
[
input_shapes
[
idx
+
self
.
n_seqs
+
1
][
1
:]]
outs_shape
+=
[
input_shapes
[
idx
+
self
.
n_seqs
+
1
][
1
:]]
# corresponding_tap = node.inputs[outer_inp_idx][mintap + k]
if
extra_infer_shape
:
# out_equivalent[self.inputs[inner_inp_idx]] = corresponding_tap
corresponding_tap
=
node
.
inputs
[
outer_inp_idx
][
mintap
+
k
]
# inner_inp_idx += 1
out_equivalent
[
self
.
inputs
[
inner_inp_idx
]]
=
corresponding_tap
# outer_inp_idx += 1
inner_inp_idx
+=
1
outer_inp_idx
+=
1
# shared_outs
# shared_outs
offset
=
1
+
self
.
n_seqs
+
n_outs
offset
=
1
+
self
.
n_seqs
+
n_outs
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论