Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
a5b4bb3a
提交
a5b4bb3a
authored
10月 09, 2017
作者:
Frédéric Bastien
提交者:
GitHub
10月 09, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6469 from nouiz/test_no_cxx
Skip test when no c++ compiler
上级
a44a3f8f
967bfd90
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
20 行增加
和
8 行删除
+20
-8
test_abstract_conv.py
theano/tensor/nnet/tests/test_abstract_conv.py
+20
-8
没有找到文件。
theano/tensor/nnet/tests/test_abstract_conv.py
浏览文件 @
a5b4bb3a
...
...
@@ -263,6 +263,8 @@ class TestAssertShape(unittest.TestCase):
@change_flags
([(
"conv.assert_shape"
,
True
)])
def
test_shape_check_conv3d
(
self
):
if
theano
.
config
.
cxx
==
""
:
raise
SkipTest
(
"test needs cxx"
)
input
=
tensor
.
tensor5
()
filters
=
tensor
.
tensor5
()
...
...
@@ -295,6 +297,8 @@ class TestAssertShape(unittest.TestCase):
@change_flags
([(
"conv.assert_shape"
,
True
)])
def
test_shape_check_conv3d_grad_wrt_inputs
(
self
):
if
theano
.
config
.
cxx
==
""
:
raise
SkipTest
(
"test needs cxx"
)
output_grad
=
tensor
.
tensor5
()
filters
=
tensor
.
tensor5
()
...
...
@@ -323,6 +327,8 @@ class TestAssertShape(unittest.TestCase):
@change_flags
([(
"conv.assert_shape"
,
True
)])
def
test_shape_check_conv3d_grad_wrt_weights
(
self
):
if
theano
.
config
.
cxx
==
""
:
raise
SkipTest
(
"test needs cxx"
)
input
=
tensor
.
tensor5
()
output_grad
=
tensor
.
tensor5
()
...
...
@@ -1330,6 +1336,8 @@ class TestConv2dTranspose(unittest.TestCase):
# This method tests that the order of the filter's
# axes expected by the function produces the correct
# output shape.
if
theano
.
config
.
cxx
==
""
:
raise
SkipTest
(
"test needs cxx"
)
mode
=
self
.
mode
if
theano
.
config
.
mode
==
"FAST_COMPILE"
:
...
...
@@ -1681,6 +1689,8 @@ class Separable_conv(unittest.TestCase):
[
51
,
110
,
286
,
299
,
298
]]]])
.
astype
(
theano
.
config
.
floatX
)
def
test_interface2d
(
self
):
if
theano
.
config
.
cxx
==
""
:
raise
SkipTest
(
"test needs cxx"
)
x_sym
=
theano
.
tensor
.
tensor4
(
'x'
)
dfilter_sym
=
theano
.
tensor
.
tensor4
(
'd'
)
pfilter_sym
=
theano
.
tensor
.
tensor4
(
'p'
)
...
...
@@ -1725,6 +1735,8 @@ class Separable_conv(unittest.TestCase):
utt
.
assert_allclose
(
top
,
self
.
precomp_output_full
)
def
test_interface3d
(
self
):
if
theano
.
config
.
cxx
==
""
:
raise
SkipTest
(
"test needs cxx"
)
# Expand the filter along the depth
x
=
np
.
tile
(
np
.
expand_dims
(
self
.
x
,
axis
=
2
),
(
1
,
1
,
5
,
1
,
1
))
depthwise_filter
=
np
.
tile
(
np
.
expand_dims
(
self
.
depthwise_filter
,
axis
=
2
),
(
1
,
1
,
3
,
1
,
1
))
...
...
@@ -1943,8 +1955,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"
)
if
theano
.
config
.
cxx
==
""
or
not
theano
.
tensor
.
nnet
.
abstract_conv
.
imported_scipy_signal
:
raise
SkipTest
(
"SciPy
and cxx
needed"
)
img_sym
=
theano
.
tensor
.
tensor4
(
'img'
)
kern_sym
=
theano
.
tensor
.
tensor4
(
'kern'
)
...
...
@@ -1979,8 +1991,8 @@ 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"
)
if
theano
.
config
.
cxx
==
""
or
not
theano
.
tensor
.
nnet
.
abstract_conv
.
imported_scipy_signal
:
raise
SkipTest
(
"SciPy
and cxx
needed"
)
img_sym
=
theano
.
tensor
.
tensor4
(
'img'
)
top_sym
=
theano
.
tensor
.
tensor4
(
'top'
)
...
...
@@ -2019,8 +2031,8 @@ class TestAsymmetricPadding(unittest.TestCase):
utt
.
verify_grad
(
conv_gradweight
,
[
img
,
top
],
mode
=
self
.
mode
,
eps
=
1
)
def
test_gradinput
(
self
):
if
not
theano
.
tensor
.
nnet
.
abstract_conv
.
imported_scipy_signal
:
raise
SkipTest
(
"
SciPy needed
"
)
if
theano
.
config
.
cxx
==
""
or
not
theano
.
tensor
.
nnet
.
abstract_conv
.
imported_scipy_signal
:
raise
SkipTest
(
"
test needs cxx and SciPy
"
)
kern_sym
=
theano
.
tensor
.
tensor4
(
'kern'
)
top_sym
=
theano
.
tensor
.
tensor4
(
'top'
)
...
...
@@ -2072,8 +2084,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"
)
if
theano
.
config
.
cxx
==
""
or
not
theano
.
tensor
.
nnet
.
abstract_conv
.
imported_scipy_signal
:
raise
SkipTest
(
"SciPy
and cxx
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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论