Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
e0897668
提交
e0897668
authored
1月 22, 2017
作者:
Iulian Vlad Serban
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed test for local_elemwise_sub_zeros. Updated comment for Canonizer.
上级
7662490d
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
9 行增加
和
10 行删除
+9
-10
opt.py
theano/tensor/opt.py
+2
-3
test_opt.py
theano/tensor/tests/test_opt.py
+7
-7
没有找到文件。
theano/tensor/opt.py
浏览文件 @
e0897668
...
@@ -4947,9 +4947,8 @@ class Canonizer(gof.LocalOptimizer):
...
@@ -4947,9 +4947,8 @@ class Canonizer(gof.LocalOptimizer):
# theano/tensor/tests/test_opt.py:T_local_switch_sink
# theano/tensor/tests/test_opt.py:T_local_switch_sink
new
.
tag
.
values_eq_approx
=
values_eq_approx_remove_inf_nan
new
.
tag
.
values_eq_approx
=
values_eq_approx_remove_inf_nan
# Julian: Pascal, maybe you can help me implement the copying of the stacktrace for this class?
# We need to implement the copy over of the stacktrace.
# Because, it's so general I think we need to copy over the stacktraces of all ops being replaced
# See issue #5104.
# to every new op?
return
[
new
]
return
[
new
]
else
:
else
:
_logger
.
warning
(
' '
.
join
((
'CANONIZE FAILED: new, out = '
,
_logger
.
warning
(
' '
.
join
((
'CANONIZE FAILED: new, out = '
,
...
...
theano/tensor/tests/test_opt.py
浏览文件 @
e0897668
...
@@ -3482,7 +3482,7 @@ def test_local_fill_useless():
...
@@ -3482,7 +3482,7 @@ def test_local_fill_useless():
def
test_local_elemwise_sub_zeros
():
def
test_local_elemwise_sub_zeros
():
# Test opt local_elemwise_sub_zeros
# Test opt local_elemwise_sub_zeros
# We test separ
et
ly for scalars, vectors and matrices
# We test separ
ate
ly for scalars, vectors and matrices
scalar
=
T
.
scalar
()
scalar
=
T
.
scalar
()
vect
=
T
.
vector
()
vect
=
T
.
vector
()
mat
=
T
.
matrix
()
mat
=
T
.
matrix
()
...
@@ -3502,8 +3502,8 @@ def test_local_elemwise_sub_zeros():
...
@@ -3502,8 +3502,8 @@ def test_local_elemwise_sub_zeros():
f
=
function
([
scalar
],
scalar
-
scalar
,
mode
=
mode
)
f
=
function
([
scalar
],
scalar
-
scalar
,
mode
=
mode
)
# Check optimized graph is correct
# Check optimized graph is correct
assert
isinstance
(
f
.
maker
.
fgraph
.
toposort
()[
0
]
.
op
,
T
.
Elemwise
)
assert
isinstance
(
f
.
maker
.
fgraph
.
toposort
()[
0
]
.
op
,
T
.
Elemwise
)
assert
f
.
maker
.
fgraph
.
toposort
()[
0
]
.
op
.
name
\
assert
isinstance
(
f
.
maker
.
fgraph
.
toposort
()[
0
]
.
op
.
scalar_op
,
==
'Elemwise{second,no_inplace}'
theano
.
scalar
.
Second
)
assert
isinstance
(
f
.
maker
.
fgraph
.
toposort
()[
0
]
.
inputs
[
1
],
assert
isinstance
(
f
.
maker
.
fgraph
.
toposort
()[
0
]
.
inputs
[
1
],
T
.
TensorConstant
)
or
\
T
.
TensorConstant
)
or
\
isinstance
(
f
.
maker
.
fgraph
.
toposort
()[
0
]
.
inputs
[
1
],
isinstance
(
f
.
maker
.
fgraph
.
toposort
()[
0
]
.
inputs
[
1
],
...
@@ -3516,8 +3516,8 @@ def test_local_elemwise_sub_zeros():
...
@@ -3516,8 +3516,8 @@ def test_local_elemwise_sub_zeros():
f
=
function
([
vect
],
vect
-
vect
,
mode
=
mode
)
f
=
function
([
vect
],
vect
-
vect
,
mode
=
mode
)
# Check optimized graph is correct
# Check optimized graph is correct
assert
isinstance
(
f
.
maker
.
fgraph
.
toposort
()[
0
]
.
op
,
T
.
Elemwise
)
assert
isinstance
(
f
.
maker
.
fgraph
.
toposort
()[
0
]
.
op
,
T
.
Elemwise
)
assert
f
.
maker
.
fgraph
.
toposort
()[
0
]
.
op
.
name
\
assert
isinstance
(
f
.
maker
.
fgraph
.
toposort
()[
0
]
.
op
.
scalar_op
,
==
'Elemwise{second,no_inplace}'
theano
.
scalar
.
Second
)
assert
isinstance
(
f
.
maker
.
fgraph
.
toposort
()[
0
]
.
inputs
[
1
],
assert
isinstance
(
f
.
maker
.
fgraph
.
toposort
()[
0
]
.
inputs
[
1
],
T
.
TensorConstant
)
or
\
T
.
TensorConstant
)
or
\
isinstance
(
f
.
maker
.
fgraph
.
toposort
()[
0
]
.
inputs
[
1
],
isinstance
(
f
.
maker
.
fgraph
.
toposort
()[
0
]
.
inputs
[
1
],
...
@@ -3530,8 +3530,8 @@ def test_local_elemwise_sub_zeros():
...
@@ -3530,8 +3530,8 @@ def test_local_elemwise_sub_zeros():
f
=
function
([
mat
],
mat
-
mat
,
mode
=
mode
)
f
=
function
([
mat
],
mat
-
mat
,
mode
=
mode
)
# Check optimized graph is correct
# Check optimized graph is correct
assert
isinstance
(
f
.
maker
.
fgraph
.
toposort
()[
0
]
.
op
,
T
.
Elemwise
)
assert
isinstance
(
f
.
maker
.
fgraph
.
toposort
()[
0
]
.
op
,
T
.
Elemwise
)
assert
f
.
maker
.
fgraph
.
toposort
()[
0
]
.
op
.
name
\
assert
isinstance
(
f
.
maker
.
fgraph
.
toposort
()[
0
]
.
op
.
scalar_op
,
==
'Elemwise{second,no_inplace}'
theano
.
scalar
.
Second
)
assert
isinstance
(
f
.
maker
.
fgraph
.
toposort
()[
0
]
.
inputs
[
1
],
assert
isinstance
(
f
.
maker
.
fgraph
.
toposort
()[
0
]
.
inputs
[
1
],
T
.
TensorConstant
)
or
\
T
.
TensorConstant
)
or
\
isinstance
(
f
.
maker
.
fgraph
.
toposort
()[
0
]
.
inputs
[
1
],
isinstance
(
f
.
maker
.
fgraph
.
toposort
()[
0
]
.
inputs
[
1
],
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论