Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
22d0a2a4
提交
22d0a2a4
authored
1月 14, 2012
作者:
Pascal Lamblin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update test to have more interesting cases tested.
上级
a7be8923
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
13 行增加
和
6 行删除
+13
-6
test_opt.py
theano/tensor/tests/test_opt.py
+13
-6
没有找到文件。
theano/tensor/tests/test_opt.py
浏览文件 @
22d0a2a4
...
@@ -1807,13 +1807,15 @@ class test_local_subtensor_merge(unittest.TestCase):
...
@@ -1807,13 +1807,15 @@ class test_local_subtensor_merge(unittest.TestCase):
#print topo[-1].op
#print topo[-1].op
assert
isinstance
(
topo
[
-
1
]
.
op
,
theano
.
compile
.
function_module
.
DeepCopyOp
)
assert
isinstance
(
topo
[
-
1
]
.
op
,
theano
.
compile
.
function_module
.
DeepCopyOp
)
b_r
=
self
.
rng
.
permutation
(
range
(
-
8
,
8
))[:
2
]
b_r
=
self
.
rng
.
permutation
(
range
(
-
4
,
4
))[:
3
]
e_r
=
self
.
rng
.
permutation
(
range
(
-
8
,
8
))[:
2
]
e_r
=
self
.
rng
.
permutation
(
range
(
-
4
,
4
))[:
3
]
i_r
=
self
.
rng
.
permutation
(
range
(
-
8
,
8
))[:
2
]
i_r
=
self
.
rng
.
permutation
(
range
(
-
4
,
4
))[:
3
]
s_r
=
self
.
rng
.
permutation
([
-
7
,
-
6
,
-
5
,
-
4
,
-
3
,
-
2
,
-
1
,
1
,
2
,
3
,
4
,
5
,
6
,
7
])[:
2
]
s_r
=
self
.
rng
.
permutation
([
-
3
,
-
2
,
-
1
,
1
,
2
,
3
])[:
3
]
for
x_s
in
self
.
x_shapes
:
for
x_s
in
self
.
x_shapes
:
n_index_err
=
0
n_ok
=
0
x_val
=
self
.
rng
.
uniform
(
size
=
x_s
)
.
astype
(
config
.
floatX
)
x_val
=
self
.
rng
.
uniform
(
size
=
x_s
)
.
astype
(
config
.
floatX
)
for
b_v
in
b_r
:
for
b_v
in
b_r
:
for
e_v
in
e_r
:
for
e_v
in
e_r
:
...
@@ -1825,13 +1827,18 @@ class test_local_subtensor_merge(unittest.TestCase):
...
@@ -1825,13 +1827,18 @@ class test_local_subtensor_merge(unittest.TestCase):
try
:
try
:
x_val
[
b_v
:
e_v
:
s_v
][
i_v
]
x_val
[
b_v
:
e_v
:
s_v
][
i_v
]
except
IndexError
:
except
IndexError
:
n_index_err
+=
1
self
.
assertRaises
(
IndexError
,
self
.
assertRaises
(
IndexError
,
f
,
x_val
,
b_v
,
e_v
,
s_v
,
i_v
)
f
,
x_val
,
b_v
,
e_v
,
s_v
,
i_v
)
else
:
else
:
# Executed if the "try" clause did not
# Executed if the "try" clause did not raise
# raise an exception
# any exception
n_ok
+=
1
f
(
x_val
,
b_v
,
e_v
,
s_v
,
i_v
)
f
(
x_val
,
b_v
,
e_v
,
s_v
,
i_v
)
print
'shape:
%
s'
%
(
x_s
,)
print
'
%%
OK:
%
f'
%
(
float
(
n_ok
)
*
100
/
(
n_ok
+
n_index_err
))
class
Test_alloc_zero
(
unittest
.
TestCase
):
class
Test_alloc_zero
(
unittest
.
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
mode
=
theano
.
compile
.
mode
.
get_default_mode
()
mode
=
theano
.
compile
.
mode
.
get_default_mode
()
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论