Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
01a3a2e0
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2299
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
01a3a2e0
编写于
8月 17, 2021
作者:
W
WeiXin
提交者:
GitHub
8月 17, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Modify the name of class in unittest with the same name (#34952)
* polish unittest. * polish code * polish code
上级
8ef1bf87
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
54 addition
and
60 deletion
+54
-60
python/paddle/fluid/tests/unittests/test_strided_slice_op.py
python/paddle/fluid/tests/unittests/test_strided_slice_op.py
+54
-60
未找到文件。
python/paddle/fluid/tests/unittests/test_strided_slice_op.py
浏览文件 @
01a3a2e0
...
...
@@ -745,173 +745,167 @@ class TestStridedSliceTensorArray(unittest.TestCase):
self
.
assertFalse
(
result
.
place
.
is_cuda_pinned_place
())
def
test_strided_slice_tensor_array
(
self
):
class
Net
(
ArrayLayer
):
class
Net
01
(
ArrayLayer
):
def
array_slice
(
self
,
tensors
):
return
tensors
[::
-
1
]
self
.
create_case
(
Net
(
array_size
=
10
))
self
.
create_case
(
Net
01
(
array_size
=
10
))
class
Net
(
ArrayLayer
):
class
Net
02
(
ArrayLayer
):
def
array_slice
(
self
,
tensors
):
return
tensors
[::
-
2
]
self
.
create_case
(
Net
(
input_size
=
112
,
array_size
=
11
))
self
.
create_case
(
Net
02
(
input_size
=
112
,
array_size
=
11
))
class
Net
(
ArrayLayer
):
class
Net
03
(
ArrayLayer
):
def
array_slice
(
self
,
tensors
):
return
tensors
[::
-
3
]
self
.
create_case
(
Net
(
input_size
=
112
,
array_size
=
9
))
self
.
create_case
(
Net
03
(
input_size
=
112
,
array_size
=
9
))
class
Net
(
ArrayLayer
):
class
Net
04
(
ArrayLayer
):
def
array_slice
(
self
,
tensors
):
return
tensors
[
1
::
-
4
]
self
.
create_case
(
Net
(
input_size
=
112
,
array_size
=
9
))
self
.
create_case
(
Net
04
(
input_size
=
112
,
array_size
=
9
))
class
Net
(
ArrayLayer
):
class
Net
05
(
ArrayLayer
):
def
array_slice
(
self
,
tensors
):
return
tensors
[:
7
:
-
4
]
self
.
create_case
(
Net
(
input_size
=
112
,
array_size
=
9
))
self
.
create_case
(
Net
05
(
input_size
=
112
,
array_size
=
9
))
class
Net
(
ArrayLayer
):
class
Net
06
(
ArrayLayer
):
def
array_slice
(
self
,
tensors
):
return
tensors
[
8
:
0
:
-
4
]
self
.
create_case
(
Net
(
input_size
=
112
,
array_size
=
9
))
self
.
create_case
(
Net
06
(
input_size
=
112
,
array_size
=
9
))
class
Net
(
ArrayLayer
):
class
Net
07
(
ArrayLayer
):
def
array_slice
(
self
,
tensors
):
return
tensors
[
8
:
1
:
-
4
]
self
.
create_case
(
Net
(
input_size
=
112
,
array_size
=
9
))
self
.
create_case
(
Net
07
(
input_size
=
112
,
array_size
=
9
))
class
Net
(
ArrayLayer
):
class
Net
08
(
ArrayLayer
):
def
array_slice
(
self
,
tensors
):
return
tensors
[::
2
]
self
.
create_case
(
Net
(
input_size
=
112
,
array_size
=
11
))
self
.
create_case
(
Net
08
(
input_size
=
112
,
array_size
=
11
))
class
Net
(
ArrayLayer
):
class
Net
09
(
ArrayLayer
):
def
array_slice
(
self
,
tensors
):
return
tensors
[::
3
]
self
.
create_case
(
Net
(
input_size
=
112
,
array_size
=
9
))
self
.
create_case
(
Net
09
(
input_size
=
112
,
array_size
=
9
))
class
Net
(
ArrayLayer
):
class
Net
10
(
ArrayLayer
):
def
array_slice
(
self
,
tensors
):
return
tensors
[
1
::
4
]
self
.
create_case
(
Net
(
input_size
=
112
,
array_size
=
9
))
self
.
create_case
(
Net
10
(
input_size
=
112
,
array_size
=
9
))
class
Net
(
ArrayLayer
):
class
Net
11
(
ArrayLayer
):
def
array_slice
(
self
,
tensors
):
return
tensors
[:
8
:
4
]
self
.
create_case
(
Net
(
input_size
=
112
,
array_size
=
9
))
self
.
create_case
(
Net
11
(
input_size
=
112
,
array_size
=
9
))
class
Net
(
ArrayLayer
):
class
Net
12
(
ArrayLayer
):
def
array_slice
(
self
,
tensors
):
return
tensors
[
1
:
8
:
4
]
self
.
create_case
(
Net
(
input_size
=
112
,
array_size
=
9
))
self
.
create_case
(
Net
12
(
input_size
=
112
,
array_size
=
9
))
class
Net
(
ArrayLayer
):
class
Net
13
(
ArrayLayer
):
def
array_slice
(
self
,
tensors
):
return
tensors
[
8
:
10
:
4
]
self
.
create_case
(
Net
(
input_size
=
112
,
array_size
=
13
))
self
.
create_case
(
Net
13
(
input_size
=
112
,
array_size
=
13
))
class
Net
(
ArrayLayer
):
class
Net
14
(
ArrayLayer
):
def
array_slice
(
self
,
tensors
):
return
tensors
[
3
:
10
:
4
]
self
.
create_case
(
Net
(
input_size
=
112
,
array_size
=
13
))
self
.
create_case
(
Net
14
(
input_size
=
112
,
array_size
=
13
))
class
Net
(
ArrayLayer
):
class
Net
15
(
ArrayLayer
):
def
array_slice
(
self
,
tensors
):
return
tensors
[
2
:
10
:
4
]
self
.
create_case
(
Net
(
input_size
=
112
,
array_size
=
13
))
self
.
create_case
(
Net
15
(
input_size
=
112
,
array_size
=
13
))
class
Net
(
ArrayLayer
):
class
Net
16
(
ArrayLayer
):
def
array_slice
(
self
,
tensors
):
return
tensors
[
3
:
10
:
3
]
self
.
create_case
(
Net
(
input_size
=
112
,
array_size
=
13
))
self
.
create_case
(
Net
16
(
input_size
=
112
,
array_size
=
13
))
class
Net
(
ArrayLayer
):
class
Net
17
(
ArrayLayer
):
def
array_slice
(
self
,
tensors
):
return
tensors
[
3
:
15
:
3
]
self
.
create_case
(
Net
(
input_size
=
112
,
array_size
=
13
))
self
.
create_case
(
Net
17
(
input_size
=
112
,
array_size
=
13
))
class
Net
(
ArrayLayer
):
class
Net
18
(
ArrayLayer
):
def
array_slice
(
self
,
tensors
):
return
tensors
[
0
:
15
:
3
]
self
.
create_case
(
Net
(
input_size
=
112
,
array_size
=
13
))
self
.
create_case
(
Net
18
(
input_size
=
112
,
array_size
=
13
))
class
Net
(
ArrayLayer
):
class
Net
19
(
ArrayLayer
):
def
array_slice
(
self
,
tensors
):
return
tensors
[
-
1
:
-
5
:
-
3
]
self
.
create_case
(
Net
(
input_size
=
112
,
array_size
=
13
))
self
.
create_case
(
Net
19
(
input_size
=
112
,
array_size
=
13
))
class
Net
(
ArrayLayer
):
class
Net
20
(
ArrayLayer
):
def
array_slice
(
self
,
tensors
):
return
tensors
[
-
1
:
-
6
:
-
3
]
self
.
create_case
(
Net
(
input_size
=
112
,
array_size
=
13
))
self
.
create_case
(
Net
20
(
input_size
=
112
,
array_size
=
13
))
class
Net
(
ArrayLayer
):
class
Net
21
(
ArrayLayer
):
def
array_slice
(
self
,
tensors
):
return
tensors
[
-
3
:
-
6
:
-
3
]
self
.
create_case
(
Net
(
input_size
=
112
,
array_size
=
13
))
self
.
create_case
(
Net
21
(
input_size
=
112
,
array_size
=
13
))
self
.
create_case
(
Net
(
input_size
=
112
,
array_size
=
13
))
class
Net
(
ArrayLayer
):
class
Net22
(
ArrayLayer
):
def
array_slice
(
self
,
tensors
):
return
tensors
[
-
5
:
-
1
:
3
]
self
.
create_case
(
Net
(
input_size
=
112
,
array_size
=
13
))
self
.
create_case
(
Net
22
(
input_size
=
112
,
array_size
=
13
))
class
Net
(
ArrayLayer
):
class
Net
23
(
ArrayLayer
):
def
array_slice
(
self
,
tensors
):
return
tensors
[
-
6
:
-
1
:
3
]
self
.
create_case
(
Net
(
input_size
=
112
,
array_size
=
13
))
self
.
create_case
(
Net
23
(
input_size
=
112
,
array_size
=
13
))
class
Net
(
ArrayLayer
):
class
Net
24
(
ArrayLayer
):
def
array_slice
(
self
,
tensors
):
return
tensors
[
-
6
:
-
3
:
3
]
self
.
create_case
(
Net
(
input_size
=
112
,
array_size
=
13
))
self
.
create_case
(
Net
24
(
input_size
=
112
,
array_size
=
13
))
class
Net
(
ArrayLayer
):
class
Net
25
(
ArrayLayer
):
def
array_slice
(
self
,
tensors
):
return
tensors
[
0
::
3
]
self
.
create_case
(
Net
(
input_size
=
112
,
array_size
=
13
))
self
.
create_case
(
Net
25
(
input_size
=
112
,
array_size
=
13
))
class
Net
(
ArrayLayer
):
class
Net
26
(
ArrayLayer
):
def
array_slice
(
self
,
tensors
):
return
tensors
[
-
60
:
20
:
3
]
self
.
create_case
(
Net
(
input_size
=
112
,
array_size
=
13
))
self
.
create_case
(
Net
26
(
input_size
=
112
,
array_size
=
13
))
class
Net
(
ArrayLayer
):
class
Net
27
(
ArrayLayer
):
def
array_slice
(
self
,
tensors
):
return
tensors
[
-
3
:
-
60
:
-
3
]
self
.
create_case
(
Net
(
input_size
=
112
,
array_size
=
13
))
class
Net
(
ArrayLayer
):
def
array_slice
(
self
,
tensors
):
return
tensors
[
-
1
:
-
60
:
-
3
]
self
.
create_case
(
Net27
(
input_size
=
112
,
array_size
=
13
))
if
__name__
==
"__main__"
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录