Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
9ae1e645
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看板
未验证
提交
9ae1e645
编写于
7月 09, 2020
作者:
石
石晓伟
提交者:
GitHub
7月 09, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
print not impl info in base classes, test=develop (#3905)
上级
8a24a31c
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
48 addition
and
18 deletion
+48
-18
lite/model_parser/base/block_desc.h
lite/model_parser/base/block_desc.h
+11
-5
lite/model_parser/base/op_desc.h
lite/model_parser/base/op_desc.h
+13
-3
lite/model_parser/base/program_desc.h
lite/model_parser/base/program_desc.h
+10
-2
lite/model_parser/base/var_desc.h
lite/model_parser/base/var_desc.h
+10
-4
lite/model_parser/flatbuffers/block_desc.h
lite/model_parser/flatbuffers/block_desc.h
+1
-1
lite/model_parser/flatbuffers/op_desc.h
lite/model_parser/flatbuffers/op_desc.h
+1
-1
lite/model_parser/flatbuffers/program_desc.h
lite/model_parser/flatbuffers/program_desc.h
+1
-1
lite/model_parser/flatbuffers/var_desc.h
lite/model_parser/flatbuffers/var_desc.h
+1
-1
未找到文件。
lite/model_parser/base/block_desc.h
浏览文件 @
9ae1e645
...
...
@@ -17,6 +17,7 @@
#include <cstdint>
#include <string>
#include <vector>
#include "lite/utils/cp_logging.h"
namespace
paddle
{
namespace
lite
{
...
...
@@ -46,11 +47,11 @@ class BlockDescReadAPI {
class
BlockDescWriteAPI
{
public:
virtual
void
SetIdx
(
int32_t
idx
)
=
0
;
virtual
void
SetParentIdx
(
int32_t
idx
)
=
0
;
virtual
void
ClearVars
()
=
0
;
virtual
void
ClearOps
()
=
0
;
virtual
void
SetForwardBlockIdx
(
int32_t
idx
)
=
0
;
virtual
void
SetIdx
(
int32_t
idx
)
{
NotImplemented
();
}
virtual
void
SetParentIdx
(
int32_t
idx
)
{
NotImplemented
();
}
virtual
void
ClearVars
()
{
NotImplemented
();
}
virtual
void
ClearOps
()
{
NotImplemented
();
}
virtual
void
SetForwardBlockIdx
(
int32_t
idx
)
{
NotImplemented
();
}
template
<
typename
T
>
T
*
AddVar
();
...
...
@@ -59,6 +60,11 @@ class BlockDescWriteAPI {
T
*
AddOp
();
virtual
~
BlockDescWriteAPI
()
=
default
;
private:
void
NotImplemented
()
{
LOG
(
FATAL
)
<<
"BlockDescWriteAPI is not available in model read-only mode."
;
}
};
// The reading and writing of the model are one-time and separate.
...
...
lite/model_parser/base/op_desc.h
浏览文件 @
9ae1e645
...
...
@@ -16,6 +16,7 @@
#include <string>
#include <vector>
#include "lite/model_parser/base/traits.h"
#include "lite/utils/cp_logging.h"
#include "lite/utils/string.h"
namespace
paddle
{
...
...
@@ -61,16 +62,25 @@ class OpDescReadAPI {
class
OpDescWriteAPI
{
public:
virtual
void
SetType
(
const
std
::
string
&
type
)
=
0
;
virtual
void
SetType
(
const
std
::
string
&
type
)
{
NotImplemented
();
}
virtual
void
SetInput
(
const
std
::
string
&
param
,
const
std
::
vector
<
std
::
string
>&
args
)
=
0
;
const
std
::
vector
<
std
::
string
>&
args
)
{
NotImplemented
();
}
virtual
void
SetOutput
(
const
std
::
string
&
param
,
const
std
::
vector
<
std
::
string
>&
args
)
=
0
;
const
std
::
vector
<
std
::
string
>&
args
)
{
NotImplemented
();
}
template
<
typename
T
>
void
SetAttr
(
const
std
::
string
&
name
,
const
T
&
v
);
virtual
~
OpDescWriteAPI
()
=
default
;
private:
void
NotImplemented
()
{
LOG
(
FATAL
)
<<
"OpDescWriteAPI is not available in model read-only mode."
;
}
};
// The reading and writing of the model are one-time and separate.
...
...
lite/model_parser/base/program_desc.h
浏览文件 @
9ae1e645
...
...
@@ -14,6 +14,8 @@
#pragma once
#include "lite/utils/cp_logging.h"
namespace
paddle
{
namespace
lite
{
...
...
@@ -34,13 +36,19 @@ class ProgramDescReadAPI {
class
ProgramDescWriteAPI
{
public:
virtual
void
ClearBlocks
()
=
0
;
virtual
void
SetVersion
(
int64_t
version
)
=
0
;
virtual
void
ClearBlocks
()
{
NotImplemented
();
}
virtual
void
SetVersion
(
int64_t
version
)
{
NotImplemented
();
}
template
<
typename
T
>
T
*
AddBlock
();
virtual
~
ProgramDescWriteAPI
()
=
default
;
private:
void
NotImplemented
()
{
LOG
(
FATAL
)
<<
"ProgramDescWriteAPI is not available in model read-only mode."
;
}
};
// The reading and writing of the model are one-time and separate.
...
...
lite/model_parser/base/var_desc.h
浏览文件 @
9ae1e645
...
...
@@ -16,6 +16,7 @@
#include <string>
#include <vector>
#include "lite/utils/cp_logging.h"
namespace
paddle
{
namespace
lite
{
...
...
@@ -62,11 +63,16 @@ class VarDescReadAPI {
class
VarDescWriteAPI
{
public:
virtual
void
SetName
(
std
::
string
name
)
=
0
;
virtual
void
SetType
(
VarDataType
type
)
=
0
;
virtual
void
SetPersistable
(
bool
persistable
)
=
0
;
virtual
void
SetShape
(
const
std
::
vector
<
int64_t
>&
dims
)
=
0
;
virtual
void
SetName
(
std
::
string
name
)
{
NotImplemented
();
}
virtual
void
SetType
(
VarDataType
type
)
{
NotImplemented
();
}
virtual
void
SetPersistable
(
bool
persistable
)
{
NotImplemented
();
}
virtual
void
SetShape
(
const
std
::
vector
<
int64_t
>&
dims
)
{
NotImplemented
();
}
virtual
~
VarDescWriteAPI
()
=
default
;
private:
void
NotImplemented
()
{
LOG
(
FATAL
)
<<
"VarDescWriteAPI is not available in model read-only mode."
;
}
};
// The reading and writing of the model are one-time and separate.
...
...
lite/model_parser/flatbuffers/block_desc.h
浏览文件 @
9ae1e645
...
...
@@ -22,7 +22,7 @@ namespace paddle {
namespace
lite
{
namespace
fbs
{
class
BlockDesc
:
public
BlockDesc
Read
API
{
class
BlockDesc
:
public
BlockDescAPI
{
public:
explicit
BlockDesc
(
proto
::
BlockDesc
*
desc
)
:
desc_
(
desc
)
{
CHECK
(
desc_
);
}
...
...
lite/model_parser/flatbuffers/op_desc.h
浏览文件 @
9ae1e645
...
...
@@ -27,7 +27,7 @@ namespace paddle {
namespace
lite
{
namespace
fbs
{
class
OpDesc
:
public
OpDesc
Read
API
{
class
OpDesc
:
public
OpDescAPI
{
public:
explicit
OpDesc
(
proto
::
OpDesc
*
desc
)
:
desc_
(
desc
)
{
CHECK
(
desc_
);
}
...
...
lite/model_parser/flatbuffers/program_desc.h
浏览文件 @
9ae1e645
...
...
@@ -23,7 +23,7 @@ namespace paddle {
namespace
lite
{
namespace
fbs
{
class
ProgramDesc
:
public
ProgramDesc
Read
API
{
class
ProgramDesc
:
public
ProgramDescAPI
{
public:
explicit
ProgramDesc
(
proto
::
ProgramDesc
*
desc
)
:
desc_
(
desc
)
{
CHECK
(
desc
);
}
...
...
lite/model_parser/flatbuffers/var_desc.h
浏览文件 @
9ae1e645
...
...
@@ -25,7 +25,7 @@ namespace paddle {
namespace
lite
{
namespace
fbs
{
class
VarDesc
:
public
VarDesc
Read
API
{
class
VarDesc
:
public
VarDescAPI
{
public:
explicit
VarDesc
(
proto
::
VarDesc
*
desc
)
:
desc_
(
desc
)
{}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录