Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
4925a648
提交
4925a648
authored
11月 26, 2016
作者:
Gijs van Tulder
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Reduce number of inconsistent-shape tests.
上级
c655fb73
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
25 行增加
和
36 行删除
+25
-36
test_abstract_conv.py
theano/tensor/nnet/tests/test_abstract_conv.py
+25
-36
没有找到文件。
theano/tensor/nnet/tests/test_abstract_conv.py
浏览文件 @
4925a648
...
@@ -500,11 +500,17 @@ class BaseTestConv2d(BaseTestConv):
...
@@ -500,11 +500,17 @@ class BaseTestConv2d(BaseTestConv):
True
)
True
)
def
test_gradinput_impossible_output_shapes
(
self
):
def
test_gradinput_impossible_output_shapes
(
self
):
for
i
in
range
(
1
,
10
):
def
run_for_output_offsets
(
image_shape
,
kernel_shape
,
s
,
border_mode
,
d
):
for
k
in
range
(
1
,
5
):
# outputs that are too large or too small should be rejected
for
o
in
(
-
3
,
-
1
,
1
,
2
):
output_shape
=
(
1
,
1
,
computed_shape
[
2
]
+
o
,
computed_shape
[
3
]
+
o
)
# expect an error
self
.
tcase_gi
(
image_shape
,
kernel_shape
,
output_shape
,
(
s
,
s
),
border_mode
,
True
,
True
,
(
d
,
d
),
True
)
for
(
i
,
k
)
in
((
1
,
1
),
(
1
,
2
),
(
2
,
1
),
(
4
,
2
),
(
4
,
3
),
(
7
,
3
),
(
9
,
5
)):
for
border_mode
in
(
'valid'
,
'half'
,
'full'
,
(
0
,
2
)):
for
border_mode
in
(
'valid'
,
'half'
,
'full'
,
(
0
,
2
)):
for
s
in
(
1
,
2
,
3
):
for
(
s
,
d
)
in
((
1
,
1
),
(
1
,
2
),
(
2
,
1
),
(
2
,
2
),
(
3
,
1
),
(
1
,
3
)):
for
d
in
(
1
,
2
,
3
):
image_shape
=
(
1
,
1
,
i
,
i
)
image_shape
=
(
1
,
1
,
i
,
i
)
kernel_shape
=
(
1
,
1
,
k
,
k
)
kernel_shape
=
(
1
,
1
,
k
,
k
)
...
@@ -512,20 +518,8 @@ class BaseTestConv2d(BaseTestConv):
...
@@ -512,20 +518,8 @@ class BaseTestConv2d(BaseTestConv):
computed_shape
=
get_conv_output_shape
(
computed_shape
=
get_conv_output_shape
(
image_shape
,
kernel_shape
,
border_mode
,
(
s
,
s
),
(
d
,
d
))
image_shape
,
kernel_shape
,
border_mode
,
(
s
,
s
),
(
d
,
d
))
# outputs that are too large or too small should be rejected
yield
(
run_for_output_offsets
,
for
o
in
(
-
3
,
-
2
,
-
1
,
1
,
2
,
3
):
image_shape
,
kernel_shape
,
s
,
border_mode
,
d
)
output_shape
=
(
1
,
1
,
computed_shape
[
2
]
+
o
,
computed_shape
[
3
]
+
o
)
# expect an error
yield
(
self
.
tcase_gi
,
image_shape
,
kernel_shape
,
output_shape
,
(
s
,
s
),
border_mode
,
True
,
True
,
(
d
,
d
),
True
)
def
run_fwd
(
self
,
inputs_shape
,
filters_shape
,
def
run_fwd
(
self
,
inputs_shape
,
filters_shape
,
conv_fn
=
conv
.
conv2d
,
conv_op
=
conv
.
AbstractConv2d
,
conv_fn
=
conv
.
conv2d
,
conv_op
=
conv
.
AbstractConv2d
,
...
@@ -862,11 +856,18 @@ class BaseTestConv3d(BaseTestConv):
...
@@ -862,11 +856,18 @@ class BaseTestConv3d(BaseTestConv):
True
)
True
)
def
test_gradinput_impossible_output_shapes
(
self
):
def
test_gradinput_impossible_output_shapes
(
self
):
for
i
in
range
(
1
,
10
):
def
run_for_output_offsets
(
image_shape
,
kernel_shape
,
s
,
border_mode
,
d
):
for
k
in
range
(
1
,
5
):
# outputs that are too large or too small should be rejected
for
o
in
(
-
3
,
-
1
,
1
,
2
):
output_shape
=
(
1
,
1
,
computed_shape
[
2
]
+
o
,
computed_shape
[
3
]
+
o
,
computed_shape
[
4
]
+
o
)
# expect an error
self
.
tcase_gi
(
image_shape
,
kernel_shape
,
output_shape
,
(
s
,
s
),
border_mode
,
True
,
True
,
(
d
,
d
),
True
)
for
(
i
,
k
)
in
((
1
,
1
),
(
1
,
2
),
(
2
,
1
),
(
4
,
2
),
(
4
,
3
),
(
7
,
3
),
(
9
,
5
)):
for
border_mode
in
(
'valid'
,
'half'
,
'full'
,
(
0
,
2
,
1
)):
for
border_mode
in
(
'valid'
,
'half'
,
'full'
,
(
0
,
2
,
1
)):
for
s
in
(
1
,
2
,
3
):
for
(
s
,
d
)
in
((
1
,
1
),
(
1
,
2
),
(
2
,
1
),
(
2
,
2
),
(
3
,
1
),
(
1
,
3
)):
for
d
in
(
1
,
2
,
3
):
image_shape
=
(
1
,
1
,
i
,
i
,
i
)
image_shape
=
(
1
,
1
,
i
,
i
,
i
)
kernel_shape
=
(
1
,
1
,
k
,
k
,
k
)
kernel_shape
=
(
1
,
1
,
k
,
k
,
k
)
...
@@ -874,20 +875,8 @@ class BaseTestConv3d(BaseTestConv):
...
@@ -874,20 +875,8 @@ class BaseTestConv3d(BaseTestConv):
computed_shape
=
get_conv_output_shape
(
computed_shape
=
get_conv_output_shape
(
image_shape
,
kernel_shape
,
border_mode
,
(
s
,
s
,
s
),
(
d
,
d
,
d
))
image_shape
,
kernel_shape
,
border_mode
,
(
s
,
s
,
s
),
(
d
,
d
,
d
))
# outputs that are too large or too small should be rejected
yield
(
run_for_output_offsets
,
for
o
in
(
-
3
,
-
2
,
-
1
,
1
,
2
,
3
):
image_shape
,
kernel_shape
,
s
,
border_mode
,
d
)
output_shape
=
(
1
,
1
,
computed_shape
[
2
]
+
o
,
computed_shape
[
3
]
+
o
,
computed_shape
[
4
]
+
o
)
yield
(
self
.
tcase_gi
,
image_shape
,
kernel_shape
,
output_shape
,
(
s
,
s
,
s
),
border_mode
,
True
,
True
,
(
d
,
d
,
d
),
True
)
def
run_fwd
(
self
,
inputs_shape
,
filters_shape
,
def
run_fwd
(
self
,
inputs_shape
,
filters_shape
,
conv_fn
=
conv
.
conv3d
,
conv_op
=
conv
.
AbstractConv3d
,
conv_fn
=
conv
.
conv3d
,
conv_op
=
conv
.
AbstractConv3d
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论