Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
914eb1be
提交
914eb1be
authored
6月 12, 2013
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
make empty list of floatX dtype.
上级
d4a825d6
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
30 行增加
和
20 行删除
+30
-20
test_basic.py
theano/tensor/tests/test_basic.py
+30
-20
没有找到文件。
theano/tensor/tests/test_basic.py
浏览文件 @
914eb1be
...
@@ -537,7 +537,8 @@ _good_broadcast_binary_normal = dict(
...
@@ -537,7 +537,8 @@ _good_broadcast_binary_normal = dict(
# Disabled as we test the case where we reuse the same output as the
# Disabled as we test the case where we reuse the same output as the
# first inputs.
# first inputs.
# complex3=(rand(2,3),randcomplex(2,3)),
# complex3=(rand(2,3),randcomplex(2,3)),
empty
=
(
numpy
.
asarray
([]),
numpy
.
asarray
([
1
])),
empty
=
(
numpy
.
asarray
([],
dtype
=
config
.
floatX
),
numpy
.
asarray
([
1
],
dtype
=
config
.
floatX
)),
)
)
_bad_build_broadcast_binary_normal
=
dict
()
_bad_build_broadcast_binary_normal
=
dict
()
...
@@ -741,7 +742,8 @@ if PY3:
...
@@ -741,7 +742,8 @@ if PY3:
else
:
else
:
_good_broadcast_div_mod_normal_float_inplace
=
copymod
(
_good_broadcast_div_mod_normal_float_inplace
=
copymod
(
_good_broadcast_div_mod_normal_float_no_complex
,
_good_broadcast_div_mod_normal_float_no_complex
,
empty1
=
(
numpy
.
asarray
([]),
numpy
.
asarray
([
1
])),
empty1
=
(
numpy
.
asarray
([],
dtype
=
config
.
floatX
),
numpy
.
asarray
([
1
],
dtype
=
config
.
floatX
)),
complex1
=
(
randcomplex
(
2
,
3
),
randcomplex_nonzero
((
2
,
3
))),
complex1
=
(
randcomplex
(
2
,
3
),
randcomplex_nonzero
((
2
,
3
))),
complex2
=
(
randcomplex
(
2
,
3
),
rand_nonzero
((
2
,
3
))),
complex2
=
(
randcomplex
(
2
,
3
),
rand_nonzero
((
2
,
3
))),
# Inplace on the first element. Must have the same type.
# Inplace on the first element. Must have the same type.
...
@@ -750,7 +752,8 @@ else:
...
@@ -750,7 +752,8 @@ else:
_good_broadcast_div_mod_normal_float
=
copymod
(
_good_broadcast_div_mod_normal_float
=
copymod
(
_good_broadcast_div_mod_normal_float_inplace
,
_good_broadcast_div_mod_normal_float_inplace
,
empty2
=
(
numpy
.
asarray
([
0
]),
numpy
.
asarray
([]))
empty2
=
(
numpy
.
asarray
([
0
],
dtype
=
config
.
floatX
),
numpy
.
asarray
([],
dtype
=
config
.
floatX
))
)
)
...
@@ -843,8 +846,13 @@ _good_broadcast_pow_normal_float = dict(same_shapes = (rand_ranged(1, 5, (2, 3))
...
@@ -843,8 +846,13 @@ _good_broadcast_pow_normal_float = dict(same_shapes = (rand_ranged(1, 5, (2, 3))
complex1
=
(
randcomplex
(
2
,
3
),
randcomplex
(
2
,
3
)),
complex1
=
(
randcomplex
(
2
,
3
),
randcomplex
(
2
,
3
)),
complex2
=
(
randcomplex
(
2
,
3
),
rand
(
2
,
3
)),
complex2
=
(
randcomplex
(
2
,
3
),
rand
(
2
,
3
)),
#complex3 = (rand(2,3),randcomplex(2,3)), # Inplace on the first element.
#complex3 = (rand(2,3),randcomplex(2,3)), # Inplace on the first element.
empty1
=
(
numpy
.
asarray
([]),
numpy
.
asarray
([
1
])),
empty1
=
(
numpy
.
asarray
([],
dtype
=
config
.
floatX
),
empty2
=
(
numpy
.
asarray
([
0
]),
numpy
.
asarray
([])),)
numpy
.
asarray
([
1
],
dtype
=
config
.
floatX
)),
empty2
=
(
numpy
.
asarray
([
0
],
dtype
=
config
.
floatX
),
numpy
.
asarray
([],
dtype
=
config
.
floatX
)),
empty3
=
(
numpy
.
asarray
([],
dtype
=
config
.
floatX
),
numpy
.
asarray
([],
dtype
=
config
.
floatX
)),
)
_grad_broadcast_pow_normal
=
dict
(
same_shapes
=
(
rand_ranged
(
1
,
5
,
(
2
,
3
)),
rand_ranged
(
-
3
,
3
,
(
2
,
3
))),
_grad_broadcast_pow_normal
=
dict
(
same_shapes
=
(
rand_ranged
(
1
,
5
,
(
2
,
3
)),
rand_ranged
(
-
3
,
3
,
(
2
,
3
))),
scalar
=
(
rand_ranged
(
1
,
5
,
(
2
,
3
)),
rand_ranged
(
-
3
,
3
,
(
1
,
1
))),
scalar
=
(
rand_ranged
(
1
,
5
,
(
2
,
3
)),
rand_ranged
(
-
3
,
3
,
(
1
,
1
))),
row
=
(
row
=
(
...
@@ -890,7 +898,7 @@ _good_broadcast_unary_normal_float = dict(
...
@@ -890,7 +898,7 @@ _good_broadcast_unary_normal_float = dict(
normal
=
[
rand_ranged
(
-
5
,
5
,
(
2
,
3
))],
normal
=
[
rand_ranged
(
-
5
,
5
,
(
2
,
3
))],
corner_case
=
[
corner_case
],
corner_case
=
[
corner_case
],
complex
=
[
randcomplex
(
2
,
3
)],
complex
=
[
randcomplex
(
2
,
3
)],
empty
=
[
numpy
.
asarray
([])])
empty
=
[
numpy
.
asarray
([]
,
dtype
=
config
.
floatX
)])
_good_broadcast_unary_normal_float_no_empty
=
copymod
(
_good_broadcast_unary_normal_float_no_empty
=
copymod
(
_good_broadcast_unary_normal_float
,
_good_broadcast_unary_normal_float
,
...
@@ -910,14 +918,14 @@ _good_broadcast_unary_normal = dict(
...
@@ -910,14 +918,14 @@ _good_broadcast_unary_normal = dict(
integers
=
[
randint_ranged
(
-
5
,
5
,
(
2
,
3
))],
integers
=
[
randint_ranged
(
-
5
,
5
,
(
2
,
3
))],
corner_case
=
[
corner_case
],
corner_case
=
[
corner_case
],
complex
=
[
randcomplex
(
2
,
3
)],
complex
=
[
randcomplex
(
2
,
3
)],
empty
=
[
numpy
.
asarray
([])],
empty
=
[
numpy
.
asarray
([]
,
dtype
=
config
.
floatX
)],
)
)
_good_broadcast_unary_normal_no_complex
=
dict
(
_good_broadcast_unary_normal_no_complex
=
dict
(
normal
=
[
numpy
.
asarray
(
rand_ranged
(
-
5
,
5
,
(
2
,
3
)),
dtype
=
floatX
)],
normal
=
[
numpy
.
asarray
(
rand_ranged
(
-
5
,
5
,
(
2
,
3
)),
dtype
=
floatX
)],
integers
=
[
randint_ranged
(
-
5
,
5
,
(
2
,
3
))],
integers
=
[
randint_ranged
(
-
5
,
5
,
(
2
,
3
))],
corner_case
=
[
corner_case
],
corner_case
=
[
corner_case
],
empty
=
[
numpy
.
asarray
([])],
empty
=
[
numpy
.
asarray
([]
,
dtype
=
config
.
floatX
)],
)
)
_grad_broadcast_unary_normal_no_complex
=
dict
(
_grad_broadcast_unary_normal_no_complex
=
dict
(
...
@@ -1124,7 +1132,7 @@ Expm1InplaceTester = makeBroadcastTester(op=inplace.expm1_inplace,
...
@@ -1124,7 +1132,7 @@ Expm1InplaceTester = makeBroadcastTester(op=inplace.expm1_inplace,
_good_broadcast_unary_positive
=
dict
(
normal
=
(
rand_ranged
(
0.001
,
5
,
(
2
,
3
)),),
_good_broadcast_unary_positive
=
dict
(
normal
=
(
rand_ranged
(
0.001
,
5
,
(
2
,
3
)),),
integers
=
(
randint_ranged
(
1
,
5
,
(
2
,
3
)),),
integers
=
(
randint_ranged
(
1
,
5
,
(
2
,
3
)),),
complex
=
(
randc128_ranged
(
1
,
5
,
(
2
,
3
)),),
complex
=
(
randc128_ranged
(
1
,
5
,
(
2
,
3
)),),
empty
=
(
numpy
.
asarray
([]),),
empty
=
(
numpy
.
asarray
([]
,
dtype
=
config
.
floatX
),),
)
)
_grad_broadcast_unary_positive
=
dict
(
normal
=
(
rand_ranged
(
0.001
,
5
,
(
2
,
3
)),),)
_grad_broadcast_unary_positive
=
dict
(
normal
=
(
rand_ranged
(
0.001
,
5
,
(
2
,
3
)),),)
...
@@ -1183,7 +1191,7 @@ _good_broadcast_unary_wide = dict(
...
@@ -1183,7 +1191,7 @@ _good_broadcast_unary_wide = dict(
normal
=
(
rand_ranged
(
-
1000
,
1000
,
(
2
,
3
)),),
normal
=
(
rand_ranged
(
-
1000
,
1000
,
(
2
,
3
)),),
integers
=
(
randint_ranged
(
-
1000
,
1000
,
(
2
,
3
)),),
integers
=
(
randint_ranged
(
-
1000
,
1000
,
(
2
,
3
)),),
complex
=
(
randc128_ranged
(
-
1000
,
1000
,
(
2
,
3
)),),
complex
=
(
randc128_ranged
(
-
1000
,
1000
,
(
2
,
3
)),),
empty
=
(
numpy
.
asarray
([]),),)
empty
=
(
numpy
.
asarray
([]
,
dtype
=
config
.
floatX
),),)
_grad_broadcast_unary_wide
=
dict
(
normal
=
(
rand_ranged
(
-
1000
,
1000
,
(
2
,
3
)),),)
_grad_broadcast_unary_wide
=
dict
(
normal
=
(
rand_ranged
(
-
1000
,
1000
,
(
2
,
3
)),),)
if
theano
.
config
.
floatX
==
'float32'
:
if
theano
.
config
.
floatX
==
'float32'
:
...
@@ -1232,7 +1240,7 @@ SinInplaceTester = makeBroadcastTester(op=inplace.sin_inplace,
...
@@ -1232,7 +1240,7 @@ SinInplaceTester = makeBroadcastTester(op=inplace.sin_inplace,
_good_broadcast_unary_arcsin
=
dict
(
normal
=
(
rand_ranged
(
-
1
,
1
,
(
2
,
3
)),),
_good_broadcast_unary_arcsin
=
dict
(
normal
=
(
rand_ranged
(
-
1
,
1
,
(
2
,
3
)),),
integers
=
(
randint_ranged
(
-
1
,
1
,
(
2
,
3
)),),
integers
=
(
randint_ranged
(
-
1
,
1
,
(
2
,
3
)),),
complex
=
(
randc128_ranged
(
-
1
,
1
,
(
2
,
3
)),),
complex
=
(
randc128_ranged
(
-
1
,
1
,
(
2
,
3
)),),
empty
=
(
numpy
.
asarray
([]),),)
empty
=
(
numpy
.
asarray
([]
,
dtype
=
config
.
floatX
),),)
_grad_broadcast_unary_arcsin
=
dict
(
normal
=
(
rand_ranged
(
-
1
,
1
,
(
2
,
3
)),),)
_grad_broadcast_unary_arcsin
=
dict
(
normal
=
(
rand_ranged
(
-
1
,
1
,
(
2
,
3
)),),)
ArcsinTester
=
makeBroadcastTester
(
op
=
tensor
.
arcsin
,
ArcsinTester
=
makeBroadcastTester
(
op
=
tensor
.
arcsin
,
...
@@ -1270,7 +1278,7 @@ _good_broadcast_unary_tan = dict(
...
@@ -1270,7 +1278,7 @@ _good_broadcast_unary_tan = dict(
shifted
=
(
rand_ranged
(
3.15
,
6.28
,
(
2
,
3
)),),
shifted
=
(
rand_ranged
(
3.15
,
6.28
,
(
2
,
3
)),),
integers
=
(
randint_ranged
(
-
3
,
3
,
(
2
,
3
)),),
integers
=
(
randint_ranged
(
-
3
,
3
,
(
2
,
3
)),),
complex
=
(
randc128_ranged
(
-
3.14
,
3.14
,
(
2
,
3
)),),
complex
=
(
randc128_ranged
(
-
3.14
,
3.14
,
(
2
,
3
)),),
empty
=
(
numpy
.
asarray
([]),),)
empty
=
(
numpy
.
asarray
([]
,
dtype
=
config
.
floatX
),),)
#We do not want to test around the discontinuity.
#We do not want to test around the discontinuity.
_grad_broadcast_unary_tan
=
dict
(
normal
=
(
rand_ranged
(
-
1.5
,
1.5
,
(
2
,
3
)),),
_grad_broadcast_unary_tan
=
dict
(
normal
=
(
rand_ranged
(
-
1.5
,
1.5
,
(
2
,
3
)),),
shifted
=
(
rand_ranged
(
1.6
,
4.6
,
(
2
,
3
)),))
shifted
=
(
rand_ranged
(
1.6
,
4.6
,
(
2
,
3
)),))
...
@@ -1305,7 +1313,8 @@ _good_broadcast_binary_arctan2 = dict(
...
@@ -1305,7 +1313,8 @@ _good_broadcast_binary_arctan2 = dict(
integers
=
(
randint
(
2
,
3
),
randint
(
2
,
3
)),
integers
=
(
randint
(
2
,
3
),
randint
(
2
,
3
)),
dtype_mixup_1
=
(
rand
(
2
,
3
),
randint
(
2
,
3
)),
dtype_mixup_1
=
(
rand
(
2
,
3
),
randint
(
2
,
3
)),
dtype_mixup_2
=
(
randint
(
2
,
3
),
rand
(
2
,
3
)),
dtype_mixup_2
=
(
randint
(
2
,
3
),
rand
(
2
,
3
)),
empty
=
(
numpy
.
asarray
([]),
numpy
.
asarray
([
1
])),
empty
=
(
numpy
.
asarray
([],
dtype
=
config
.
floatX
),
numpy
.
asarray
([
1
],
dtype
=
config
.
floatX
)),
)
)
_grad_broadcast_binary_arctan2
=
dict
(
_grad_broadcast_binary_arctan2
=
dict
(
...
@@ -1339,7 +1348,7 @@ _good_broadcast_unary_arccosh = dict(
...
@@ -1339,7 +1348,7 @@ _good_broadcast_unary_arccosh = dict(
normal
=
(
rand_ranged
(
1
,
1000
,
(
2
,
3
)),),
normal
=
(
rand_ranged
(
1
,
1000
,
(
2
,
3
)),),
integers
=
(
randint_ranged
(
1
,
1000
,
(
2
,
3
)),),
integers
=
(
randint_ranged
(
1
,
1000
,
(
2
,
3
)),),
complex
=
(
randc128_ranged
(
1
,
1000
,
(
2
,
3
)),),
complex
=
(
randc128_ranged
(
1
,
1000
,
(
2
,
3
)),),
empty
=
(
numpy
.
asarray
([]),),)
empty
=
(
numpy
.
asarray
([]
,
dtype
=
config
.
floatX
),),)
_grad_broadcast_unary_arccosh
=
dict
(
normal
=
(
rand_ranged
(
1
,
1000
,
(
2
,
3
)),),)
_grad_broadcast_unary_arccosh
=
dict
(
normal
=
(
rand_ranged
(
1
,
1000
,
(
2
,
3
)),),)
ArccoshTester
=
makeBroadcastTester
(
op
=
tensor
.
arccosh
,
ArccoshTester
=
makeBroadcastTester
(
op
=
tensor
.
arccosh
,
...
@@ -1387,7 +1396,7 @@ _good_broadcast_unary_arctanh = dict(
...
@@ -1387,7 +1396,7 @@ _good_broadcast_unary_arctanh = dict(
normal
=
(
rand_ranged
(
-
1
+
_eps
,
1
-
_eps
,
(
2
,
3
)),),
normal
=
(
rand_ranged
(
-
1
+
_eps
,
1
-
_eps
,
(
2
,
3
)),),
integers
=
(
randint_ranged
(
-
1
+
_eps
,
1
-
_eps
,
(
2
,
3
)),),
integers
=
(
randint_ranged
(
-
1
+
_eps
,
1
-
_eps
,
(
2
,
3
)),),
complex
=
(
randc128_ranged
(
-
1
+
_eps
,
1
-
_eps
,
(
2
,
3
)),),
complex
=
(
randc128_ranged
(
-
1
+
_eps
,
1
-
_eps
,
(
2
,
3
)),),
empty
=
(
numpy
.
asarray
([]),),)
empty
=
(
numpy
.
asarray
([]
,
dtype
=
config
.
floatX
),),)
_grad_broadcast_unary_arctanh
=
dict
(
_grad_broadcast_unary_arctanh
=
dict
(
normal
=
(
rand_ranged
(
-
1
+
_eps
,
1
-
_eps
,
(
2
,
3
)),),)
normal
=
(
rand_ranged
(
-
1
+
_eps
,
1
-
_eps
,
(
2
,
3
)),),)
...
@@ -1490,7 +1499,7 @@ ErfcinvTester = makeBroadcastTester(
...
@@ -1490,7 +1499,7 @@ ErfcinvTester = makeBroadcastTester(
_good_broadcast_unary_gammaln
=
dict
(
_good_broadcast_unary_gammaln
=
dict
(
normal
=
(
rand_ranged
(
-
1
+
1e-2
,
10
,
(
2
,
3
)),),
normal
=
(
rand_ranged
(
-
1
+
1e-2
,
10
,
(
2
,
3
)),),
empty
=
(
numpy
.
asarray
([]),),)
empty
=
(
numpy
.
asarray
([]
,
dtype
=
config
.
floatX
),),)
_grad_broadcast_unary_gammaln
=
dict
(
_grad_broadcast_unary_gammaln
=
dict
(
# smaller range as our grad method does not estimate it well enough.
# smaller range as our grad method does not estimate it well enough.
normal
=
(
rand_ranged
(
1e-8
,
8
,
(
2
,
3
)),),)
normal
=
(
rand_ranged
(
1e-8
,
8
,
(
2
,
3
)),),)
...
@@ -1533,7 +1542,7 @@ GammalnInplaceTester = makeBroadcastTester(
...
@@ -1533,7 +1542,7 @@ GammalnInplaceTester = makeBroadcastTester(
_good_broadcast_unary_psi
=
dict
(
_good_broadcast_unary_psi
=
dict
(
normal
=
(
rand_ranged
(
1
,
10
,
(
2
,
3
)),),
normal
=
(
rand_ranged
(
1
,
10
,
(
2
,
3
)),),
empty
=
(
numpy
.
asarray
([]),),)
empty
=
(
numpy
.
asarray
([]
,
dtype
=
config
.
floatX
),),)
PsiTester
=
makeBroadcastTester
(
PsiTester
=
makeBroadcastTester
(
op
=
tensor
.
psi
,
op
=
tensor
.
psi
,
...
@@ -1600,7 +1609,8 @@ _good_complex_from_polar = dict(
...
@@ -1600,7 +1609,8 @@ _good_complex_from_polar = dict(
row
=
(
abs
(
rand
(
2
,
3
)),
rand
(
1
,
3
)),
row
=
(
abs
(
rand
(
2
,
3
)),
rand
(
1
,
3
)),
column
=
(
abs
(
rand
(
2
,
3
)),
rand
(
2
,
1
)),
column
=
(
abs
(
rand
(
2
,
3
)),
rand
(
2
,
1
)),
integers
=
(
abs
(
randint
(
2
,
3
)),
randint
(
2
,
3
)),
integers
=
(
abs
(
randint
(
2
,
3
)),
randint
(
2
,
3
)),
empty
=
(
numpy
.
asarray
([]),
numpy
.
asarray
([
1
])),)
empty
=
(
numpy
.
asarray
([],
dtype
=
config
.
floatX
),
numpy
.
asarray
([
1
],
dtype
=
config
.
floatX
)),)
_grad_complex_from_polar
=
dict
(
_grad_complex_from_polar
=
dict
(
same_shapes
=
(
abs
(
rand
(
2
,
3
)),
rand
(
2
,
3
)),
same_shapes
=
(
abs
(
rand
(
2
,
3
)),
rand
(
2
,
3
)),
scalar
=
(
abs
(
rand
(
2
,
3
)),
rand
(
1
,
1
)),
scalar
=
(
abs
(
rand
(
2
,
3
)),
rand
(
1
,
1
)),
...
@@ -1639,8 +1649,8 @@ DotTester = makeTester(name='DotTester',
...
@@ -1639,8 +1649,8 @@ DotTester = makeTester(name='DotTester',
randcomplex
(
7
)),
randcomplex
(
7
)),
complex2
=
(
rand
(
5
,
7
),
randcomplex
(
7
)),
complex2
=
(
rand
(
5
,
7
),
randcomplex
(
7
)),
complex3
=
(
randcomplex
(
5
,
7
),
rand
(
7
)),
complex3
=
(
randcomplex
(
5
,
7
),
rand
(
7
)),
empty1
=
(
numpy
.
asarray
([]),
empty1
=
(
numpy
.
asarray
([]
,
dtype
=
config
.
floatX
),
numpy
.
asarray
([])),
numpy
.
asarray
([]
,
dtype
=
config
.
floatX
)),
empty2
=
(
rand
(
5
,
0
),
rand
(
0
,
2
)),
empty2
=
(
rand
(
5
,
0
),
rand
(
0
,
2
)),
empty3
=
(
rand
(
0
,
5
),
rand
(
5
,
0
)),
empty3
=
(
rand
(
0
,
5
),
rand
(
5
,
0
)),
),
),
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论