Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
3136ac1c
提交
3136ac1c
authored
4月 08, 2015
作者:
orhanf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
including/excluding 'unsafe' modes added, 'unsafe' registered in tensor/opt, tests updated
上级
b359a356
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
24 行增加
和
2 行删除
+24
-2
test_opt.py
theano/sandbox/cuda/tests/test_opt.py
+5
-1
test_opt.py
theano/sandbox/gpuarray/tests/test_opt.py
+5
-1
opt.py
theano/tensor/opt.py
+3
-0
test_opt.py
theano/tensor/tests/test_opt.py
+11
-0
没有找到文件。
theano/sandbox/cuda/tests/test_opt.py
浏览文件 @
3136ac1c
...
...
@@ -59,10 +59,14 @@ def test_local_assert():
def
test_local_remove_all_assert
():
x
=
theano
.
tensor
.
fmatrix
()
a
=
theano
.
tensor
.
opt
.
assert_op
(
x
,
theano
.
tensor
.
eq
(
x
,
0
)
.
any
())
f
=
theano
.
function
([
x
],
a
,
mode
=
mode_with_gpu
)
f
=
theano
.
function
([
x
],
a
,
mode
=
mode_with_gpu
.
including
(
'unsafe'
)
)
topo
=
f
.
maker
.
fgraph
.
toposort
()
a_op
=
[
n
for
n
in
topo
if
isinstance
(
n
.
op
,
theano
.
tensor
.
opt
.
Assert
)]
assert
len
(
a_op
)
==
0
f
=
theano
.
function
([
x
],
a
,
mode
=
mode_with_gpu
.
excluding
(
'unsafe'
))
topo
=
f
.
maker
.
fgraph
.
toposort
()
a_op
=
[
n
for
n
in
topo
if
isinstance
(
n
.
op
,
theano
.
tensor
.
opt
.
Assert
)]
assert
len
(
a_op
)
==
1
def
test_int_pow
():
...
...
theano/sandbox/gpuarray/tests/test_opt.py
浏览文件 @
3136ac1c
...
...
@@ -28,10 +28,14 @@ def test_local_assert():
def
test_local_remove_all_assert
():
x
=
theano
.
tensor
.
fmatrix
()
a
=
theano
.
tensor
.
opt
.
assert_op
(
x
,
theano
.
tensor
.
eq
(
x
,
0
)
.
any
())
f
=
theano
.
function
([
x
],
a
,
mode
=
mode_with_gpu
)
f
=
theano
.
function
([
x
],
a
,
mode
=
mode_with_gpu
.
including
(
'unsafe'
)
)
topo
=
f
.
maker
.
fgraph
.
toposort
()
a_op
=
[
n
for
n
in
topo
if
isinstance
(
n
.
op
,
theano
.
tensor
.
opt
.
Assert
)]
assert
len
(
a_op
)
==
0
f
=
theano
.
function
([
x
],
a
,
mode
=
mode_with_gpu
.
excluding
(
'unsafe'
))
topo
=
f
.
maker
.
fgraph
.
toposort
()
a_op
=
[
n
for
n
in
topo
if
isinstance
(
n
.
op
,
theano
.
tensor
.
opt
.
Assert
)]
assert
len
(
a_op
)
==
1
def
test_flatten
():
...
...
theano/tensor/opt.py
浏览文件 @
3136ac1c
...
...
@@ -1670,12 +1670,15 @@ def local_remove_all_assert(node):
# Disabled by default
compile
.
optdb
[
'canonicalize'
]
.
register
(
'local_remove_all_assert'
,
local_remove_all_assert
,
'unsafe'
,
use_db_name_as_tag
=
False
)
compile
.
optdb
[
'stabilize'
]
.
register
(
'local_remove_all_assert'
,
local_remove_all_assert
,
'unsafe'
,
use_db_name_as_tag
=
False
)
compile
.
optdb
[
'specialize'
]
.
register
(
'local_remove_all_assert'
,
local_remove_all_assert
,
'unsafe'
,
use_db_name_as_tag
=
False
)
...
...
theano/tensor/tests/test_opt.py
浏览文件 @
3136ac1c
...
...
@@ -3553,6 +3553,17 @@ class test_assert(utt.InferShapeTester):
assert
len
(
topo
)
==
1
,
topo
assert
topo
[
0
]
.
op
==
deep_copy_op
,
topo
mode
=
compile
.
mode
.
get_default_mode
()
a
=
theano
.
tensor
.
opt
.
assert_op
(
x
,
T
.
eq
(
x
,
0
)
.
any
())
f
=
theano
.
function
([
x
],
a
,
mode
=
mode
.
including
(
'unsafe'
))
topo
=
f
.
maker
.
fgraph
.
toposort
()
a_op
=
[
n
for
n
in
topo
if
isinstance
(
n
.
op
,
T
.
opt
.
Assert
)]
assert
len
(
a_op
)
==
0
f
=
theano
.
function
([
x
],
a
,
mode
=
mode
.
excluding
(
'unsafe'
))
topo
=
f
.
maker
.
fgraph
.
toposort
()
a_op
=
[
n
for
n
in
topo
if
isinstance
(
n
.
op
,
T
.
opt
.
Assert
)]
assert
len
(
a_op
)
==
1
def
test_infer_shape
(
self
):
adscal
=
dscalar
()
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论