Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
e6e1d921
提交
e6e1d921
authored
6月 04, 2016
作者:
Vincent Michalski
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
applied changes suggested by Pascal
上级
4044c411
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
4 行增加
和
22 行删除
+4
-22
test_opt.py
theano/tensor/tests/test_opt.py
+4
-22
没有找到文件。
theano/tensor/tests/test_opt.py
浏览文件 @
e6e1d921
...
...
@@ -1950,33 +1950,16 @@ class test_local_subtensor_make_vector(unittest.TestCase):
x
,
y
,
z
=
tensor
.
lscalars
(
'xyz'
)
v
=
make_vector
(
x
,
y
,
z
)
# Compile functions in two modes:
# - only with 'local_subtensor_make_vector' (requires adding
# the 'canonicalize' phase)
# - all optimizations in fast_compile including the
# 'local_subtensor_make_vector' optimization
modes
=
[
theano
.
compile
.
mode
.
Mode
(
optimizer
=
None
)
.
including
(
'canonicalize_db'
)
.
including
(
"local_subtensor_make_vector"
),
theano
.
compile
.
mode
.
get_mode
(
'FAST_COMPILE'
)
.
including
(
mode
=
theano
.
compile
.
mode
.
get_default_mode
()
.
including
(
"local_subtensor_make_vector"
)
]
# list of subtensor cases, where local_subtensor_make_vector
# inserts a new MakeVector node
v_subtensors
=
[
v
[:
2
],
v
[::
2
],
v
[[
0
,
2
]]]
for
mode
in
modes
:
# case, where local_subtensor_make_vector only removes nodes
# FIXME: remove this useless case, where the graph only contains a
# DeepCopyOp? Or is there a meaningful test case for constant
# scalar index subtensor?
f
=
function
([
x
,
y
,
z
],
v
[
0
],
mode
=
mode
)
# cases, where local_subtensor_make_vector inserts nodes
for
v_subtensor
in
v_subtensors
:
f
=
function
([
x
,
y
,
z
],
v_subtensor
,
mode
=
mode
)
self
.
assertTrue
(
check_stack_trace
(
f
,
ops_to_check
=
'all'
))
for
v_subtensor
in
v_subtensors
:
f
=
function
([
x
,
y
,
z
],
v_subtensor
,
mode
=
mode
)
self
.
assertTrue
(
check_stack_trace
(
f
,
ops_to_check
=
'all'
))
class
test_local_subtensor_lift
(
unittest
.
TestCase
):
...
...
@@ -4167,7 +4150,6 @@ class T_Tile(unittest.TestCase):
f
(
data
)
# In this case the opt only removes nodes,
# no need to check_stack_trace
# See issue #4421
def
speed_local_pow_specialize_range
():
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论