Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
2202eb41
提交
2202eb41
authored
11月 25, 2015
作者:
Tim Cooijmans
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
BatchedDot: more diverse tests
上级
bee1a7a0
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
32 行增加
和
13 行删除
+32
-13
test_basic.py
theano/tensor/tests/test_basic.py
+32
-13
没有找到文件。
theano/tensor/tests/test_basic.py
浏览文件 @
2202eb41
...
@@ -1931,12 +1931,17 @@ DotTester = makeTester(name='DotTester',
...
@@ -1931,12 +1931,17 @@ DotTester = makeTester(name='DotTester',
bad_build
=
dict
(),
bad_build
=
dict
(),
bad_runtime
=
dict
(
bad1
=
(
rand
(
5
,
7
),
rand
(
5
,
7
)),
bad_runtime
=
dict
(
bad1
=
(
rand
(
5
,
7
),
rand
(
5
,
7
)),
bad2
=
(
rand
(
5
,
7
),
rand
(
8
,
3
))))
bad2
=
(
rand
(
5
,
7
),
rand
(
8
,
3
))))
BatchedDotTester
=
makeTester
(
BatchedDotTester
=
makeTester
(
name
=
'BatchedDotTester'
,
name
=
'BatchedDotTester'
,
op
=
batched_dot
,
op
=
batched_dot
,
expected
=
lambda
xs
,
ys
:
numpy
.
asarray
(
expected
=
(
lambda
xs
,
ys
:
list
(
numpy
.
dot
(
x
,
y
)
for
x
,
y
in
zip
(
xs
,
ys
)),
numpy
.
asarray
(
dtype
=
theano
.
scalar
.
upcast
(
xs
.
dtype
,
ys
.
dtype
)),
list
(
x
*
y
if
x
.
ndim
==
0
or
y
.
ndim
==
0
else
(
numpy
.
dot
(
x
,
y
)
if
y
.
ndim
==
1
else
numpy
.
tensordot
(
x
,
y
,
[[
x
.
ndim
-
1
],
[
y
.
ndim
-
2
]]))
for
x
,
y
in
zip
(
xs
,
ys
)),
dtype
=
theano
.
scalar
.
upcast
(
xs
.
dtype
,
ys
.
dtype
))),
checks
=
{},
checks
=
{},
grad
=
dict
(
correct1
=
(
rand
(
3
,
5
,
7
),
rand
(
3
,
7
,
5
)),
grad
=
dict
(
correct1
=
(
rand
(
3
,
5
,
7
),
rand
(
3
,
7
,
5
)),
correct2
=
(
rand
(
3
,
5
,
7
),
rand
(
3
,
7
,
9
)),
correct2
=
(
rand
(
3
,
5
,
7
),
rand
(
3
,
7
,
9
)),
...
@@ -1944,6 +1949,12 @@ BatchedDotTester = makeTester(
...
@@ -1944,6 +1949,12 @@ BatchedDotTester = makeTester(
correct4
=
(
rand
(
3
,
5
),
rand
(
3
,
5
,
7
)),
correct4
=
(
rand
(
3
,
5
),
rand
(
3
,
5
,
7
)),
correct5
=
(
rand
(
3
),
rand
(
3
,
5
,
7
)),
correct5
=
(
rand
(
3
),
rand
(
3
,
5
,
7
)),
correct6
=
(
rand
(
3
,
5
),
rand
(
3
)),
correct6
=
(
rand
(
3
,
5
),
rand
(
3
)),
correct7
=
(
rand
(
3
,
5
),
rand
(
3
,
5
)),
correct8
=
(
rand
(
3
),
rand
(
3
)),
correct9
=
(
rand
(
3
,
5
,
7
,
11
),
rand
(
3
)),
correct10
=
(
rand
(
3
,
7
,
11
,
5
),
rand
(
3
,
5
)),
correct11
=
(
rand
(
3
,
7
,
11
,
5
),
rand
(
3
,
5
,
13
)),
correct12
=
(
rand
(
3
,
7
,
11
,
5
),
rand
(
3
,
13
,
5
,
17
)),
mixed1
=
(
rand
(
3
,
5
)
.
astype
(
'float32'
),
mixed1
=
(
rand
(
3
,
5
)
.
astype
(
'float32'
),
rand
(
3
,
5
,
7
)),
rand
(
3
,
5
,
7
)),
mixed2
=
(
rand
(
3
,
5
)
.
astype
(
'float64'
),
mixed2
=
(
rand
(
3
,
5
)
.
astype
(
'float64'
),
...
@@ -1954,6 +1965,12 @@ BatchedDotTester = makeTester(
...
@@ -1954,6 +1965,12 @@ BatchedDotTester = makeTester(
correct4
=
(
rand
(
3
,
5
),
rand
(
3
,
5
,
7
)),
correct4
=
(
rand
(
3
,
5
),
rand
(
3
,
5
,
7
)),
correct5
=
(
rand
(
3
),
rand
(
3
,
5
,
7
)),
correct5
=
(
rand
(
3
),
rand
(
3
,
5
,
7
)),
correct6
=
(
rand
(
3
,
5
),
rand
(
3
)),
correct6
=
(
rand
(
3
,
5
),
rand
(
3
)),
correct7
=
(
rand
(
3
,
5
),
rand
(
3
,
5
)),
correct8
=
(
rand
(
3
),
rand
(
3
)),
correct9
=
(
rand
(
3
,
5
,
7
,
11
),
rand
(
3
)),
correct10
=
(
rand
(
3
,
7
,
11
,
5
),
rand
(
3
,
5
)),
correct11
=
(
rand
(
3
,
7
,
11
,
5
),
rand
(
3
,
5
,
13
)),
correct12
=
(
rand
(
3
,
7
,
11
,
5
),
rand
(
3
,
13
,
5
,
17
)),
mixed1
=
(
rand
(
3
,
5
)
.
astype
(
'float32'
),
mixed1
=
(
rand
(
3
,
5
)
.
astype
(
'float32'
),
rand
(
3
,
5
,
7
)),
rand
(
3
,
5
,
7
)),
mixed2
=
(
rand
(
3
,
5
)
.
astype
(
'float64'
),
mixed2
=
(
rand
(
3
,
5
)
.
astype
(
'float64'
),
...
@@ -1961,16 +1978,18 @@ BatchedDotTester = makeTester(
...
@@ -1961,16 +1978,18 @@ BatchedDotTester = makeTester(
complex1
=
(
randcomplex
(
3
,
5
,
7
),
complex1
=
(
randcomplex
(
3
,
5
,
7
),
randcomplex
(
3
,
7
)),
randcomplex
(
3
,
7
)),
complex2
=
(
rand
(
3
,
5
,
7
),
randcomplex
(
3
,
7
)),
complex2
=
(
rand
(
3
,
5
,
7
),
randcomplex
(
3
,
7
)),
complex3
=
(
randcomplex
(
3
,
5
,
7
),
rand
(
3
,
7
)),
complex3
=
(
randcomplex
(
3
,
5
,
7
),
rand
(
3
,
7
))),
empty1
=
(
numpy
.
asarray
([],
dtype
=
config
.
floatX
),
bad_build
=
dict
(
no_batch_axis2
=
(
rand
(),
rand
(
3
,
5
)),
numpy
.
asarray
([],
dtype
=
config
.
floatX
)),
no_batch_axis3
=
(
rand
(
3
,
5
),
rand
())),
empty2
=
(
rand
(
3
,
5
,
0
),
rand
(
3
,
0
,
2
)),
bad_runtime
=
dict
(
batch_dim_mismatch1
=
(
rand
(
2
,
5
,
7
),
rand
(
3
,
7
,
9
)),
empty3
=
(
rand
(
3
,
0
,
5
),
rand
(
3
,
5
,
0
))),
batch_dim_mismatch2
=
(
rand
(
3
,
5
,
7
),
rand
(
2
,
7
,
9
)),
bad_build
=
dict
(),
batch_dim_mismatch3
=
(
rand
(
3
),
rand
(
5
)),
bad_runtime
=
dict
(
bad1
=
(
rand
(
3
,
5
,
7
),
rand
(
3
,
5
,
7
)),
bad_dim1
=
(
rand
(
3
,
5
,
7
),
rand
(
3
,
5
,
7
)),
bad2
=
(
rand
(
3
,
5
,
7
),
rand
(
3
,
8
,
3
)),
bad_dim2
=
(
rand
(
3
,
5
,
7
),
rand
(
3
,
8
,
3
)),
bad3
=
(
rand
(
2
,
5
,
7
),
rand
(
3
,
7
,
9
)),
bad_dim3
=
(
rand
(
3
,
5
),
rand
(
3
,
7
)),
bad4
=
(
rand
(
3
,
5
,
7
),
rand
(
2
,
7
,
9
))))
bad_dim4
=
(
rand
(
3
,
5
,
7
,
11
),
rand
(
3
,
5
)),
bad_dim5
=
(
rand
(
3
,
5
,
7
,
11
),
rand
(
3
,
5
,
13
)),
bad_dim6
=
(
rand
(
3
,
5
,
7
,
11
),
rand
(
3
,
13
,
5
,
17
))))
def
_numpy_second
(
x
,
y
):
def
_numpy_second
(
x
,
y
):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论