Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
2848ff23
提交
2848ff23
authored
7月 06, 2011
作者:
Olivier Delalleau
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed some broken tests when scipy is not available
上级
c2ee569c
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
25 行增加
和
5 行删除
+25
-5
test_linalg.py
theano/sandbox/linalg/tests/test_linalg.py
+9
-0
test_sp.py
theano/sparse/sandbox/test_sp.py
+6
-1
test_conv3d.py
theano/tensor/nnet/tests/test_conv3d.py
+7
-3
test_sharedvar.py
theano/tensor/tests/test_sharedvar.py
+3
-1
没有找到文件。
theano/sandbox/linalg/tests/test_linalg.py
浏览文件 @
2848ff23
import
numpy
import
numpy
import
theano
import
theano
import
theano.sparse
# To know if scipy is available.
from
theano
import
tensor
,
function
from
theano
import
tensor
,
function
from
theano.tensor.basic
import
_allclose
from
theano.tensor.basic
import
_allclose
from
theano.sandbox.linalg.ops
import
*
from
theano.sandbox.linalg.ops
import
*
from
nose.plugins.skip
import
SkipTest
if
0
:
if
0
:
def
test_cholesky
():
def
test_cholesky
():
#TODO: test upper and lower triangular
#TODO: test upper and lower triangular
...
@@ -59,6 +63,11 @@ def test_inverse_grad():
...
@@ -59,6 +63,11 @@ def test_inverse_grad():
def
test_det_grad
():
def
test_det_grad
():
# If scipy is not available, this test will fail, thus we skip it.
# Note that currently we re-use the `enable_sparse` flag, but it may be
# cleaner to have a different `scipy_available` flag in the future.
if
not
theano
.
sparse
.
enable_sparse
:
raise
SkipTest
(
'Scipy is not available'
)
rng
=
numpy
.
random
.
RandomState
(
1234
)
rng
=
numpy
.
random
.
RandomState
(
1234
)
r
=
rng
.
randn
(
5
,
5
)
r
=
rng
.
randn
(
5
,
5
)
...
...
theano/sparse/sandbox/test_sp.py
浏览文件 @
2848ff23
import
sys
import
sys
from
nose.plugins.skip
import
SkipTest
import
theano.sparse
if
not
theano
.
sparse
.
enable_sparse
:
raise
SkipTest
(
'Optional package sparse disabled'
)
from
theano
import
function
,
Mode
from
theano
import
function
,
Mode
from
theano.gof
import
OpWiseCLinker
from
theano.gof
import
OpWiseCLinker
import
theano
,
numpy
import
theano
,
numpy
import
theano.tensor
as
T
import
theano.tensor
as
T
import
theano.sparse
import
scipy.sparse
import
scipy.sparse
from
scipy.signal
import
convolve2d
from
scipy.signal
import
convolve2d
...
...
theano/tensor/nnet/tests/test_conv3d.py
浏览文件 @
2848ff23
import
unittest
import
unittest
import
theano
import
theano
import
theano.tensor
as
T
import
theano.tensor
as
T
from
theano
import
function
from
theano
import
function
,
shared
from
theano.tests
import
unittest_tools
as
utt
from
theano.tests
import
unittest_tools
as
utt
from
theano.tensor.nnet.ConvTransp3D
import
convTransp3D
from
theano.tensor.nnet.ConvTransp3D
import
convTransp3D
from
theano.tensor.nnet.ConvGrad3D
import
convGrad3D
from
theano.tensor.nnet.ConvGrad3D
import
convGrad3D
from
theano.tensor.nnet.Conv3D
import
conv3D
from
theano.tensor.nnet.Conv3D
import
conv3D
import
numpy
as
N
import
numpy
as
N
import
copy
import
copy
from
scipy
import
sparse
import
theano.sparse
from
theano
import
shared
if
theano
.
sparse
.
enable_sparse
:
from
scipy
import
sparse
from
nose.plugins.skip
import
SkipTest
floatX
=
theano
.
config
.
floatX
floatX
=
theano
.
config
.
floatX
...
@@ -311,6 +313,8 @@ class TestConv3D(unittest.TestCase):
...
@@ -311,6 +313,8 @@ class TestConv3D(unittest.TestCase):
def
test_c_against_sparse_mat_transp_mul
(
self
):
def
test_c_against_sparse_mat_transp_mul
(
self
):
#like test_c_against_mat_transp_mul but using a sparse matrix and a kernel that is smaller than the image
#like test_c_against_mat_transp_mul but using a sparse matrix and a kernel that is smaller than the image
if
not
theano
.
sparse
.
enable_sparse
:
raise
SkipTest
(
'Optional package sparse disabled'
)
batchSize
=
self
.
rng
.
randint
(
1
,
3
)
batchSize
=
self
.
rng
.
randint
(
1
,
3
)
filterWidth
=
self
.
rng
.
randint
(
1
,
8
)
filterWidth
=
self
.
rng
.
randint
(
1
,
8
)
...
...
theano/tensor/tests/test_sharedvar.py
浏览文件 @
2848ff23
...
@@ -7,6 +7,7 @@ from theano.gof.python25 import all
...
@@ -7,6 +7,7 @@ from theano.gof.python25 import all
from
theano
import
tensor
from
theano
import
tensor
from
theano.tests
import
unittest_tools
as
utt
from
theano.tests
import
unittest_tools
as
utt
from
theano.misc.may_share_memory
import
may_share_memory
from
theano.misc.may_share_memory
import
may_share_memory
import
theano.sparse
utt
.
seed_rng
()
utt
.
seed_rng
()
...
@@ -445,7 +446,8 @@ def makeSharedTester(shared_constructor_,
...
@@ -445,7 +446,8 @@ def makeSharedTester(shared_constructor_,
topo_cst
[
0
]
.
op
==
theano
.
compile
.
function_module
.
deep_copy_op
topo_cst
[
0
]
.
op
==
theano
.
compile
.
function_module
.
deep_copy_op
# Test that we can take the grad.
# Test that we can take the grad.
if
isinstance
(
x1_specify_shape
.
type
,
theano
.
sparse
.
SparseType
):
if
(
theano
.
sparse
.
enable_sparse
and
isinstance
(
x1_specify_shape
.
type
,
theano
.
sparse
.
SparseType
)):
#SparseVariable don't support sum for now.
#SparseVariable don't support sum for now.
assert
not
hasattr
(
x1_specify_shape
,
'sum'
)
assert
not
hasattr
(
x1_specify_shape
,
'sum'
)
else
:
else
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论