Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
07a689b6
提交
07a689b6
authored
9月 26, 2017
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
skip tests when scipy isn't there
上级
be494716
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
25 行增加
和
15 行删除
+25
-15
test_linalg.py
theano/gpuarray/tests/test_linalg.py
+3
-1
test_opt.py
theano/gpuarray/tests/test_opt.py
+8
-8
test_abstract_conv.py
theano/tensor/nnet/tests/test_abstract_conv.py
+14
-6
没有找到文件。
theano/gpuarray/tests/test_linalg.py
浏览文件 @
07a689b6
...
...
@@ -14,7 +14,7 @@ from theano.gpuarray.linalg import (GpuCholesky, GpuMagmaCholesky,
gpu_solve
,
gpu_svd
,
gpu_qr
)
from
theano.tensor.nlinalg
import
(
SVD
,
MatrixInverse
,
QRFull
,
QRIncomplete
,
eigh
,
matrix_inverse
,
qr
)
from
theano.tensor.slinalg
import
Cholesky
,
cholesky
from
theano.tensor.slinalg
import
Cholesky
,
cholesky
,
imported_scipy
from
theano.tests
import
unittest_tools
as
utt
from
..
import
gpuarray_shared_constructor
...
...
@@ -149,6 +149,8 @@ class TestGpuCholesky(unittest.TestCase):
utt
.
assert_allclose
(
chol_A_res
,
chol_A_val
)
def
test_gpu_cholesky_opt
(
self
):
if
not
imported_scipy
:
self
.
skipTest
(
'SciPy is not enabled, skipping test'
)
A
=
theano
.
tensor
.
matrix
(
"A"
,
dtype
=
"float32"
)
fn
=
theano
.
function
([
A
],
cholesky
(
A
),
mode
=
mode_with_gpu
)
assert
any
([
isinstance
(
node
.
op
,
GpuCholesky
)
...
...
theano/gpuarray/tests/test_opt.py
浏览文件 @
07a689b6
...
...
@@ -645,8 +645,8 @@ def test_no_complex():
@utt.assertFailure_fast
def
test_local_lift_solve
():
if
not
cusolver_available
:
raise
SkipTest
(
'No cuSolver'
)
if
not
cusolver_available
or
not
slinalg
.
imported_scipy
:
raise
SkipTest
(
'No cuSolver
or SciPy
'
)
A
=
tensor
.
fmatrix
()
b
=
tensor
.
fmatrix
()
o
=
slinalg
.
solve
(
A
,
b
)
...
...
@@ -663,8 +663,8 @@ def test_local_lift_solve():
def
test_gpu_solve_not_inplace
():
if
not
cusolver_available
:
raise
SkipTest
(
'No cuSolver'
)
if
not
cusolver_available
or
not
slinalg
.
imported_scipy
:
raise
SkipTest
(
'No cuSolver
or Scipy
'
)
A
=
tensor
.
fmatrix
()
b
=
tensor
.
fmatrix
()
s
=
slinalg
.
solve
(
A
,
b
)
...
...
@@ -681,8 +681,8 @@ def test_gpu_solve_not_inplace():
@utt.assertFailure_fast
def
test_local_lift_cholesky
():
if
not
cusolver_available
:
raise
SkipTest
(
'No cuSolver'
)
if
not
cusolver_available
or
not
slinalg
.
imported_scipy
:
raise
SkipTest
(
'No cuSolver
or Scipy
'
)
A
=
tensor
.
fmatrix
()
o
=
slinalg
.
cholesky
(
A
)
f_cpu
=
theano
.
function
([
A
],
o
,
mode
=
mode_without_gpu
)
...
...
@@ -699,8 +699,8 @@ def test_local_lift_cholesky():
def
test_gpu_cholesky_not_inplace
():
if
not
cusolver_available
:
raise
SkipTest
(
'No cuSolver'
)
if
not
cusolver_available
or
not
slinalg
.
imported_scipy
:
raise
SkipTest
(
'No cuSolver
or SciPy
'
)
A
=
tensor
.
fmatrix
()
A_squared
=
A
**
2
B
=
slinalg
.
cholesky
(
A_squared
)
...
...
theano/tensor/nnet/tests/test_abstract_conv.py
浏览文件 @
07a689b6
...
...
@@ -741,6 +741,8 @@ class TestAbstractConvNoOptim(BaseTestConv2d):
cls
.
border_modes
=
[
"valid"
,
"half"
,
"full"
]
cls
.
filter_flip
=
[
True
]
cls
.
provide_shape
=
[
False
]
if
not
theano
.
tensor
.
nnet
.
abstract_conv
.
imported_scipy_signal
:
raise
SkipTest
(
"SciPy needed"
)
def
tcase
(
self
,
i
,
f
,
s
,
b
,
flip
,
provide_shape
,
fd
=
(
1
,
1
)):
o
=
self
.
get_output_shape
(
i
,
f
,
s
,
b
,
fd
)
...
...
@@ -1454,8 +1456,8 @@ class Grouped_conv_noOptim(unittest.TestCase):
self
.
corr_fwd
=
conv2d_corr
self
.
corr_gradw
=
conv2d_corr_gw
self
.
corr_gradi
=
conv2d_corr_gi
if
theano
.
config
.
cxx
==
""
:
raise
SkipTest
(
"CorrMM needs cxx"
)
if
theano
.
config
.
cxx
==
""
or
not
theano
.
tensor
.
nnet
.
abstract_conv
.
imported_scipy_signal
:
raise
SkipTest
(
"CorrMM needs cxx
and SciPy
"
)
def
test_fwd
(
self
):
if
self
.
convdim
==
2
:
...
...
@@ -1621,7 +1623,7 @@ class Grouped_conv3d_noOptim(Grouped_conv_noOptim):
self
.
corr_fwd
=
conv3d_corr
self
.
corr_gradw
=
conv3d_corr_gw
self
.
corr_gradi
=
conv3d_corr_gi
if
theano
.
config
.
cxx
==
""
:
if
theano
.
config
.
cxx
==
""
or
not
theano
.
tensor
.
nnet
.
abstract_conv
.
imported_scipy_signal
:
raise
SkipTest
(
"CorrMM needs cxx"
)
...
...
@@ -1770,8 +1772,8 @@ class TestUnsharedConv(unittest.TestCase):
self
.
verify_flags
=
[
True
]
*
4
self
.
ref_mode
=
'FAST_RUN'
if
theano
.
config
.
cxx
==
""
:
raise
SkipTest
(
"CorrMM needs cxx"
)
if
theano
.
config
.
cxx
==
""
or
not
theano
.
tensor
.
nnet
.
abstract_conv
.
imported_scipy_signal
:
raise
SkipTest
(
"CorrMM needs cxx
or SciPy
"
)
def
test_fwd
(
self
):
tensor6
=
theano
.
tensor
.
TensorType
(
theano
.
config
.
floatX
,
(
False
,)
*
6
)
...
...
@@ -1913,6 +1915,8 @@ class TestAsymmetricPadding(unittest.TestCase):
border_mode
=
[((
1
,
2
),
(
2
,
1
)),
((
1
,
1
),
(
0
,
3
)),
((
2
,
1
),
(
0
,
0
))]
def
test_fwd
(
self
):
if
not
theano
.
tensor
.
nnet
.
abstract_conv
.
imported_scipy_signal
:
raise
SkipTest
(
"SciPy needed"
)
img_sym
=
theano
.
tensor
.
tensor4
(
'img'
)
kern_sym
=
theano
.
tensor
.
tensor4
(
'kern'
)
...
...
@@ -1947,6 +1951,9 @@ class TestAsymmetricPadding(unittest.TestCase):
utt
.
verify_grad
(
asymmetric_conv_op
,
[
img
,
kern
],
mode
=
self
.
mode
,
eps
=
1
)
def
test_gradweight
(
self
):
if
not
theano
.
tensor
.
nnet
.
abstract_conv
.
imported_scipy_signal
:
raise
SkipTest
(
"SciPy needed"
)
img_sym
=
theano
.
tensor
.
tensor4
(
'img'
)
top_sym
=
theano
.
tensor
.
tensor4
(
'top'
)
...
...
@@ -2035,7 +2042,8 @@ class TestCausalConv(unittest.TestCase):
def
test_interface
(
self
):
img_sym
=
theano
.
tensor
.
tensor3
(
'img'
)
kern_sym
=
theano
.
tensor
.
tensor3
(
'kern'
)
if
not
theano
.
tensor
.
nnet
.
abstract_conv
.
imported_scipy_signal
:
raise
SkipTest
(
"SciPy needed"
)
sym_out
=
causal_conv1d
(
img_sym
,
kern_sym
,
self
.
kern
.
shape
,
filter_dilation
=
self
.
dilation
)
causal_func
=
theano
.
function
([
img_sym
,
kern_sym
],
sym_out
,
mode
=
self
.
mode
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论