Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
810415ed
提交
810415ed
authored
3月 31, 2011
作者:
Pascal Lamblin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update sparse test to test more combinations.
上级
55cd62b2
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
10 行增加
和
10 行删除
+10
-10
test_basic.py
theano/sparse/tests/test_basic.py
+10
-10
没有找到文件。
theano/sparse/tests/test_basic.py
浏览文件 @
810415ed
...
@@ -347,9 +347,13 @@ class test_structureddot(unittest.TestCase):
...
@@ -347,9 +347,13 @@ class test_structureddot(unittest.TestCase):
def
test_dot_sparse_sparse
(
self
):
def
test_dot_sparse_sparse
(
self
):
#test dot for 2 input sparse matrix
#test dot for 2 input sparse matrix
sparse_dtype
=
'float64'
sparse_dtype
=
'float64'
for
sparse_format
in
[
'csc'
,
'csr'
]:
sp_mat
=
{
'csc'
:
sp
.
csc_matrix
,
a
=
SparseType
(
sparse_format
,
dtype
=
sparse_dtype
)()
'csr'
:
sp
.
csr_matrix
}
b
=
SparseType
(
sparse_format
,
dtype
=
sparse_dtype
)()
for
sparse_format_a
in
[
'csc'
,
'csr'
]:
for
sparse_format_b
in
[
'csc'
,
'csr'
]:
a
=
SparseType
(
sparse_format_a
,
dtype
=
sparse_dtype
)()
b
=
SparseType
(
sparse_format_b
,
dtype
=
sparse_dtype
)()
d
=
theano
.
dot
(
a
,
b
)
d
=
theano
.
dot
(
a
,
b
)
f
=
theano
.
function
([
a
,
b
],
theano
.
Out
(
d
,
borrow
=
True
))
f
=
theano
.
function
([
a
,
b
],
theano
.
Out
(
d
,
borrow
=
True
))
topo
=
f
.
maker
.
env
.
toposort
()
topo
=
f
.
maker
.
env
.
toposort
()
...
@@ -358,13 +362,9 @@ class test_structureddot(unittest.TestCase):
...
@@ -358,13 +362,9 @@ class test_structureddot(unittest.TestCase):
(
40
,
30
,
20
,
30
),
(
40
,
30
,
20
,
30
),
(
400
,
3000
,
200
,
6000
),
(
400
,
3000
,
200
,
6000
),
]:
]:
if
sparse_format
==
'csc'
:
a_val
=
sp_mat
[
sparse_format_a
](
random_lil
((
M
,
N
),
sparse_dtype
,
nnz
))
spmat
=
sp
.
csc_matrix
(
random_lil
((
M
,
N
),
sparse_dtype
,
nnz
))
b_val
=
sp_mat
[
sparse_format_b
](
random_lil
((
N
,
K
),
sparse_dtype
,
nnz
))
spmat2
=
sp
.
csc_matrix
(
random_lil
((
N
,
K
),
sparse_dtype
,
nnz
))
f
(
a_val
,
b_val
)
elif
sparse_format
==
'csr'
:
spmat
=
sp
.
csr_matrix
(
random_lil
((
M
,
N
),
sparse_dtype
,
nnz
))
spmat2
=
sp
.
csr_matrix
(
random_lil
((
N
,
K
),
sparse_dtype
,
nnz
))
f
(
spmat
,
spmat2
)
def
test_csc_correct_output_faster_than_scipy
(
self
):
def
test_csc_correct_output_faster_than_scipy
(
self
):
sparse_dtype
=
'float64'
sparse_dtype
=
'float64'
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论