Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
4466bea8
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
331
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
271
列表
看板
标记
里程碑
合并请求
78
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle-Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
271
Issue
271
列表
看板
标记
里程碑
合并请求
78
合并请求
78
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
4466bea8
编写于
9月 09, 2020
作者:
石
石晓伟
提交者:
GitHub
9月 09, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change the style of literal, test=develop (#4269)
上级
53db8325
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
10 addition
and
10 deletion
+10
-10
lite/model_parser/flatbuffers/test_helper.h
lite/model_parser/flatbuffers/test_helper.h
+10
-10
未找到文件。
lite/model_parser/flatbuffers/test_helper.h
浏览文件 @
4466bea8
...
@@ -78,12 +78,12 @@ inline std::vector<char> GenerateProgramCache() {
...
@@ -78,12 +78,12 @@ inline std::vector<char> GenerateProgramCache() {
inline
void
CheckProgramCache
(
ProgramDesc
*
program
)
{
inline
void
CheckProgramCache
(
ProgramDesc
*
program
)
{
CHECK_EQ
(
program
->
Version
(),
1000600
);
CHECK_EQ
(
program
->
Version
(),
1000600
);
CHECK_EQ
(
program
->
BlocksSize
(),
static_cast
<
size_t
>
(
2
)
);
CHECK_EQ
(
program
->
BlocksSize
(),
2u
);
/* --------- Check Block A --------- */
/* --------- Check Block A --------- */
BlockDesc
block_a
(
program
->
GetBlock
<
proto
::
BlockDescT
>
(
0
));
BlockDesc
block_a
(
program
->
GetBlock
<
proto
::
BlockDescT
>
(
0
));
CHECK_EQ
(
block_a
.
OpsSize
(),
static_cast
<
size_t
>
(
1
)
);
CHECK_EQ
(
block_a
.
OpsSize
(),
1u
);
CHECK_EQ
(
block_a
.
VarsSize
(),
static_cast
<
size_t
>
(
2
)
);
CHECK_EQ
(
block_a
.
VarsSize
(),
2u
);
auto
var_a2
=
VarDesc
(
block_a
.
GetVar
<
proto
::
VarDescT
>
(
0
));
auto
var_a2
=
VarDesc
(
block_a
.
GetVar
<
proto
::
VarDescT
>
(
0
));
CHECK
(
var_a2
.
GetShape
()
==
std
::
vector
<
int64_t
>
({
2
,
2
,
1
}));
CHECK
(
var_a2
.
GetShape
()
==
std
::
vector
<
int64_t
>
({
2
,
2
,
1
}));
...
@@ -101,8 +101,8 @@ inline void CheckProgramCache(ProgramDesc* program) {
...
@@ -101,8 +101,8 @@ inline void CheckProgramCache(ProgramDesc* program) {
/* --------- Check Block B --------- */
/* --------- Check Block B --------- */
BlockDesc
block_b
(
program
->
GetBlock
<
proto
::
BlockDescT
>
(
1
));
BlockDesc
block_b
(
program
->
GetBlock
<
proto
::
BlockDescT
>
(
1
));
CHECK_EQ
(
block_b
.
OpsSize
(),
static_cast
<
size_t
>
(
2
)
);
CHECK_EQ
(
block_b
.
OpsSize
(),
2u
);
CHECK_EQ
(
block_b
.
VarsSize
(),
static_cast
<
size_t
>
(
1
)
);
CHECK_EQ
(
block_b
.
VarsSize
(),
1u
);
auto
op_b0
=
OpDesc
(
block_b
.
GetOp
<
proto
::
OpDescT
>
(
1
));
auto
op_b0
=
OpDesc
(
block_b
.
GetOp
<
proto
::
OpDescT
>
(
1
));
CHECK_EQ
(
op_b0
.
GetAttr
<
bool
>
(
"Attr1"
),
true
);
CHECK_EQ
(
op_b0
.
GetAttr
<
bool
>
(
"Attr1"
),
true
);
...
@@ -111,12 +111,12 @@ inline void CheckProgramCache(ProgramDesc* program) {
...
@@ -111,12 +111,12 @@ inline void CheckProgramCache(ProgramDesc* program) {
inline
void
CheckProgramCache
(
const
ProgramDescView
&
program
)
{
inline
void
CheckProgramCache
(
const
ProgramDescView
&
program
)
{
CHECK_EQ
(
program
.
Version
(),
1000600
);
CHECK_EQ
(
program
.
Version
(),
1000600
);
CHECK_EQ
(
program
.
BlocksSize
(),
static_cast
<
size_t
>
(
2
)
);
CHECK_EQ
(
program
.
BlocksSize
(),
2u
);
/* --------- Check Block A --------- */
/* --------- Check Block A --------- */
const
auto
&
block_a
=
*
program
.
GetBlock
<
BlockDescView
>
(
0
);
const
auto
&
block_a
=
*
program
.
GetBlock
<
BlockDescView
>
(
0
);
CHECK_EQ
(
block_a
.
OpsSize
(),
static_cast
<
size_t
>
(
1
)
);
CHECK_EQ
(
block_a
.
OpsSize
(),
1u
);
CHECK_EQ
(
block_a
.
VarsSize
(),
static_cast
<
size_t
>
(
2
)
);
CHECK_EQ
(
block_a
.
VarsSize
(),
2u
);
const
auto
&
var_a2
=
*
block_a
.
GetVar
<
VarDescView
>
(
0
);
const
auto
&
var_a2
=
*
block_a
.
GetVar
<
VarDescView
>
(
0
);
CHECK
(
var_a2
.
GetShape
()
==
std
::
vector
<
int64_t
>
({
2
,
2
,
1
}));
CHECK
(
var_a2
.
GetShape
()
==
std
::
vector
<
int64_t
>
({
2
,
2
,
1
}));
...
@@ -135,8 +135,8 @@ inline void CheckProgramCache(const ProgramDescView& program) {
...
@@ -135,8 +135,8 @@ inline void CheckProgramCache(const ProgramDescView& program) {
/* --------- Check Block B --------- */
/* --------- Check Block B --------- */
const
auto
&
block_b
=
*
program
.
GetBlock
<
BlockDescView
>
(
1
);
const
auto
&
block_b
=
*
program
.
GetBlock
<
BlockDescView
>
(
1
);
CHECK_EQ
(
block_b
.
OpsSize
(),
static_cast
<
size_t
>
(
2
)
);
CHECK_EQ
(
block_b
.
OpsSize
(),
2u
);
CHECK_EQ
(
block_b
.
VarsSize
(),
static_cast
<
size_t
>
(
1
)
);
CHECK_EQ
(
block_b
.
VarsSize
(),
1u
);
const
auto
&
op_b0
=
*
block_b
.
GetOp
<
OpDescView
>
(
1
);
const
auto
&
op_b0
=
*
block_b
.
GetOp
<
OpDescView
>
(
1
);
CHECK_EQ
(
op_b0
.
GetAttr
<
bool
>
(
"Attr1"
),
true
);
CHECK_EQ
(
op_b0
.
GetAttr
<
bool
>
(
"Attr1"
),
true
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录