Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
6fe5f212
提交
6fe5f212
authored
6月 29, 2015
作者:
Caglar
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
few other cosmetic changes.
reverted back the min to numpy.min revert back to zip from izip.
上级
dff25cb4
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
5 行增加
和
6 行删除
+5
-6
scan_opt.py
theano/scan_module/scan_opt.py
+5
-6
没有找到文件。
theano/scan_module/scan_opt.py
浏览文件 @
6fe5f212
...
@@ -61,7 +61,6 @@ import logging
...
@@ -61,7 +61,6 @@ import logging
import
copy
import
copy
from
sys
import
maxsize
from
sys
import
maxsize
import
numpy
import
numpy
from
itertools
import
izip
import
theano
import
theano
from
theano
import
tensor
from
theano
import
tensor
...
@@ -297,7 +296,7 @@ class PushOutNonSeqScan(gof.Optimizer):
...
@@ -297,7 +296,7 @@ class PushOutNonSeqScan(gof.Optimizer):
'which is not allowed to move. Report '
'which is not allowed to move. Report '
'this on theano-users list'
),
x
)
'this on theano-users list'
),
x
)
outside_ins
=
[
x
.
type
.
filter_variable
(
y
)
for
x
,
y
in
outside_ins
=
[
x
.
type
.
filter_variable
(
y
)
for
x
,
y
in
i
zip
(
nd
.
inputs
,
outside_ins
)]
zip
(
nd
.
inputs
,
outside_ins
)]
# Do not call make_node for test_value
# Do not call make_node for test_value
nw_outer_node
=
nd
.
op
(
*
outside_ins
,
nw_outer_node
=
nd
.
op
(
*
outside_ins
,
...
@@ -345,7 +344,7 @@ class PushOutNonSeqScan(gof.Optimizer):
...
@@ -345,7 +344,7 @@ class PushOutNonSeqScan(gof.Optimizer):
givens
=
OrderedDict
()
givens
=
OrderedDict
()
nw_outer
=
[]
nw_outer
=
[]
nw_inner
=
[]
nw_inner
=
[]
for
to_repl
,
repl_in
,
repl_out
in
i
zip
(
clean_to_replace
,
for
to_repl
,
repl_in
,
repl_out
in
zip
(
clean_to_replace
,
clean_replace_with_in
,
clean_replace_with_in
,
clean_replace_with_out
):
clean_replace_with_out
):
if
isinstance
(
repl_out
,
theano
.
Constant
):
if
isinstance
(
repl_out
,
theano
.
Constant
):
...
@@ -467,7 +466,7 @@ class PushOutSeqScan(gof.Optimizer):
...
@@ -467,7 +466,7 @@ class PushOutSeqScan(gof.Optimizer):
isinstance
(
x
,
tensor
.
Constant
)
or
isinstance
(
x
,
tensor
.
Constant
)
or
(
x
in
inner_seqs_set
)
(
x
in
inner_seqs_set
)
for
x
in
nd
.
inputs
])
and
for
x
in
nd
.
inputs
])
and
not
nd
in
to_remove_set
):
nd
not
in
to_remove_set
):
to_remove_add
(
nd
)
to_remove_add
(
nd
)
outside_ins
=
[]
outside_ins
=
[]
depends_on_seqs
=
False
depends_on_seqs
=
False
...
@@ -580,7 +579,7 @@ class PushOutSeqScan(gof.Optimizer):
...
@@ -580,7 +579,7 @@ class PushOutSeqScan(gof.Optimizer):
givens
=
OrderedDict
()
givens
=
OrderedDict
()
nw_outer
=
[]
nw_outer
=
[]
nw_inner
=
[]
nw_inner
=
[]
for
to_repl
,
repl_in
,
repl_out
in
i
zip
(
clean_to_replace
,
for
to_repl
,
repl_in
,
repl_out
in
zip
(
clean_to_replace
,
clean_replace_with_in
,
clean_replace_with_in
,
clean_replace_with_out
):
clean_replace_with_out
):
if
isinstance
(
repl_out
,
theano
.
Constant
):
if
isinstance
(
repl_out
,
theano
.
Constant
):
...
@@ -621,7 +620,7 @@ class PushOutSeqScan(gof.Optimizer):
...
@@ -621,7 +620,7 @@ class PushOutSeqScan(gof.Optimizer):
if
out
in
op
.
inner_mitsot_outs
(
ls
):
if
out
in
op
.
inner_mitsot_outs
(
ls
):
odx
=
op
.
inner_mitsot_outs
(
ls
)
.
index
(
out
)
odx
=
op
.
inner_mitsot_outs
(
ls
)
.
index
(
out
)
inp
=
op
.
outer_mitsot
(
node
)[
odx
]
inp
=
op
.
outer_mitsot
(
node
)[
odx
]
st
=
abs
(
min
(
op
.
mitsot_taps
()))
st
=
abs
(
numpy
.
min
(
op
.
mitsot_taps
()))
y
=
tensor
.
set_subtensor
(
inp
[
st
:],
_y
)
y
=
tensor
.
set_subtensor
(
inp
[
st
:],
_y
)
elif
out
in
op
.
inner_sitsot_outs
(
ls
):
elif
out
in
op
.
inner_sitsot_outs
(
ls
):
odx
=
op
.
inner_sitsot_outs
(
ls
)
.
index
(
out
)
odx
=
op
.
inner_sitsot_outs
(
ls
)
.
index
(
out
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论