Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
6721b880
提交
6721b880
authored
8月 28, 2014
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
skip some tests when scipy isn't available.
上级
0fb7831a
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
12 行增加
和
2 行删除
+12
-2
test_basic.py
theano/sparse/tests/test_basic.py
+1
-1
test_basic.py
theano/typed_list/tests/test_basic.py
+11
-1
没有找到文件。
theano/sparse/tests/test_basic.py
浏览文件 @
6721b880
...
@@ -19,7 +19,7 @@ from theano.gof.python25 import all, any, product
...
@@ -19,7 +19,7 @@ from theano.gof.python25 import all, any, product
from
theano.tensor.basic
import
_allclose
from
theano.tensor.basic
import
_allclose
if
not
enable_sparse
:
if
not
enable_sparse
:
raise
SkipTest
(
'Optional package
sparse disab
led'
)
raise
SkipTest
(
'Optional package
SciPy not instal
led'
)
from
theano.sparse.basic
import
_is_dense
,
_is_sparse
,
_mtypes
from
theano.sparse.basic
import
_is_dense
,
_is_sparse
,
_mtypes
from
theano.sparse.basic
import
_is_dense_variable
,
_is_sparse_variable
from
theano.sparse.basic
import
_is_dense_variable
,
_is_sparse_variable
...
...
theano/typed_list/tests/test_basic.py
浏览文件 @
6721b880
import
unittest
import
unittest
from
nose.plugins.skip
import
SkipTest
import
numpy
import
numpy
import
theano
import
theano
...
@@ -12,7 +13,12 @@ from theano.typed_list.basic import (GetItem, Insert,
...
@@ -12,7 +13,12 @@ from theano.typed_list.basic import (GetItem, Insert,
Index
,
Count
,
Length
)
Index
,
Count
,
Length
)
from
theano
import
sparse
from
theano
import
sparse
from
theano.tests
import
unittest_tools
as
utt
from
theano.tests
import
unittest_tools
as
utt
import
scipy.sparse
as
sp
# TODO, handle the case where scipy isn't installed.
try
:
import
scipy.sparse
as
sp
scipy_imported
=
True
except
ImportError
:
scipy_imported
=
False
#took from tensors/tests/test_basic.py
#took from tensors/tests/test_basic.py
...
@@ -435,6 +441,8 @@ class test_index(unittest.TestCase):
...
@@ -435,6 +441,8 @@ class test_index(unittest.TestCase):
self
.
assertTrue
(
f
([[
x
,
y
],
[
x
,
y
,
y
]],
[
x
,
y
])
==
0
)
self
.
assertTrue
(
f
([[
x
,
y
],
[
x
,
y
,
y
]],
[
x
,
y
])
==
0
)
def
test_sparse
(
self
):
def
test_sparse
(
self
):
if
not
scipy_imported
:
raise
SkipTest
(
'Optional package SciPy not installed'
)
mySymbolicSparseList
=
TypedListType
(
sparse
.
SparseType
(
'csr'
,
mySymbolicSparseList
=
TypedListType
(
sparse
.
SparseType
(
'csr'
,
theano
.
config
.
floatX
))()
theano
.
config
.
floatX
))()
mySymbolicSparse
=
sparse
.
csr_matrix
()
mySymbolicSparse
=
sparse
.
csr_matrix
()
...
@@ -499,6 +507,8 @@ class test_count(unittest.TestCase):
...
@@ -499,6 +507,8 @@ class test_count(unittest.TestCase):
self
.
assertTrue
(
f
([[
x
,
y
],
[
x
,
y
,
y
]],
[
x
,
y
])
==
1
)
self
.
assertTrue
(
f
([[
x
,
y
],
[
x
,
y
,
y
]],
[
x
,
y
])
==
1
)
def
test_sparse
(
self
):
def
test_sparse
(
self
):
if
not
scipy_imported
:
raise
SkipTest
(
'Optional package SciPy not installed'
)
mySymbolicSparseList
=
TypedListType
(
sparse
.
SparseType
(
'csr'
,
mySymbolicSparseList
=
TypedListType
(
sparse
.
SparseType
(
'csr'
,
theano
.
config
.
floatX
))()
theano
.
config
.
floatX
))()
mySymbolicSparse
=
sparse
.
csr_matrix
()
mySymbolicSparse
=
sparse
.
csr_matrix
()
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论