Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
d2f8befa
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
338
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看板
提交
d2f8befa
编写于
5月 16, 2018
作者:
L
liuruilong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
format files
上级
c9ffe855
变更
60
隐藏空白更改
内联
并排
Showing
60 changed file
with
3606 addition
and
3616 deletion
+3606
-3616
src/common/type_define.h
src/common/type_define.h
+13
-14
src/common/types.h
src/common/types.h
+1
-2
src/common/variant.h
src/common/variant.h
+11
-23
src/framework/attribute.cpp
src/framework/attribute.cpp
+1
-1
src/framework/attribute.h
src/framework/attribute.h
+64
-69
src/framework/block_desc.cpp
src/framework/block_desc.cpp
+2
-2
src/framework/block_desc.h
src/framework/block_desc.h
+6
-7
src/framework/data_layout.h
src/framework/data_layout.h
+14
-14
src/framework/data_transform.cpp
src/framework/data_transform.cpp
+8
-8
src/framework/data_transform.h
src/framework/data_transform.h
+7
-7
src/framework/data_type.h
src/framework/data_type.h
+1
-1
src/framework/ddim.cc
src/framework/ddim.cc
+76
-91
src/framework/ddim.h
src/framework/ddim.h
+6
-10
src/framework/dim.h
src/framework/dim.h
+55
-79
src/framework/executor.cpp
src/framework/executor.cpp
+2
-2
src/framework/executor.h
src/framework/executor.h
+5
-6
src/framework/framework.pb.cpp
src/framework/framework.pb.cpp
+1757
-1704
src/framework/framework.pb.h
src/framework/framework.pb.h
+1012
-984
src/framework/lod_tensor.cc
src/framework/lod_tensor.cc
+26
-16
src/framework/lod_tensor.h
src/framework/lod_tensor.h
+9
-8
src/framework/op_desc.cpp
src/framework/op_desc.cpp
+2
-2
src/framework/op_desc.h
src/framework/op_desc.h
+4
-4
src/framework/op_info.h
src/framework/op_info.h
+16
-20
src/framework/op_kernel_type.h
src/framework/op_kernel_type.h
+7
-7
src/framework/op_proto_maker.h
src/framework/op_proto_maker.h
+2
-2
src/framework/operator.cpp
src/framework/operator.cpp
+8
-14
src/framework/operator.h
src/framework/operator.h
+20
-22
src/framework/paddle_mobile_object.h
src/framework/paddle_mobile_object.h
+5
-5
src/framework/program.cpp
src/framework/program.cpp
+1
-1
src/framework/program.h
src/framework/program.h
+4
-4
src/framework/program_desc.cpp
src/framework/program_desc.cpp
+2
-2
src/framework/program_desc.h
src/framework/program_desc.h
+4
-4
src/framework/scope.cc
src/framework/scope.cc
+2
-2
src/framework/scope.h
src/framework/scope.h
+23
-23
src/framework/selected_rows.h
src/framework/selected_rows.h
+10
-10
src/framework/tensor.h
src/framework/tensor.h
+12
-20
src/framework/tensor_util.cc
src/framework/tensor_util.cc
+44
-48
src/framework/tensor_util.h
src/framework/tensor_util.h
+17
-17
src/framework/var_desc.cpp
src/framework/var_desc.cpp
+2
-2
src/framework/var_desc.h
src/framework/var_desc.h
+21
-21
src/framework/var_type.h
src/framework/var_type.h
+2
-2
src/framework/variable.h
src/framework/variable.h
+21
-25
src/io.cpp
src/io.cpp
+99
-99
src/io.h
src/io.h
+3
-3
src/memory/t_malloc.cc
src/memory/t_malloc.cc
+2
-2
src/memory/t_malloc.h
src/memory/t_malloc.h
+6
-8
src/operators/conv_op.cpp
src/operators/conv_op.cpp
+2
-2
src/operators/conv_op.h
src/operators/conv_op.h
+6
-6
src/operators/kernel/arm/conv_kernel.cpp
src/operators/kernel/arm/conv_kernel.cpp
+8
-8
src/operators/kernel/conv_kernel.h
src/operators/kernel/conv_kernel.h
+1
-1
src/operators/math/im2col.cc
src/operators/math/im2col.cc
+33
-37
src/operators/math/im2col.h
src/operators/math/im2col.h
+12
-12
src/operators/math/math_function.cc
src/operators/math/math_function.cc
+17
-17
src/operators/math/math_function.h
src/operators/math/math_function.h
+11
-11
src/operators/math/vol2col.cc
src/operators/math/vol2col.cc
+17
-19
src/operators/math/vol2col.h
src/operators/math/vol2col.h
+13
-15
src/operators/op_param.cpp
src/operators/op_param.cpp
+3
-3
src/operators/op_param.h
src/operators/op_param.h
+6
-6
src/platform/data_type.h
src/platform/data_type.h
+56
-56
src/platform/macros.h
src/platform/macros.h
+6
-6
未找到文件。
src/common/type_define.h
浏览文件 @
d2f8befa
...
...
@@ -17,15 +17,14 @@ SOFTWARE.
==============================================================================*/
#pragma once;
#include "framework/attribute.h"
#include <map>
#include <string>
#include "framework/attribute.h"
namespace
paddle_mobile
{
namespace
framework
{
template
<
typename
Dtype
>
class
OperatorBase
;
template
<
typename
Dtype
>
class
OperatorBase
;
class
OpDesc
;
class
BlockDesc
;
class
InferShapeContext
;
...
...
@@ -34,20 +33,20 @@ class InferShapeContext;
using
VariableNameMap
=
std
::
map
<
std
::
string
,
std
::
vector
<
std
::
string
>>
;
template
<
typename
Dtype
>
using
OpCreator
=
std
::
function
<
framework
::
OperatorBase
<
Dtype
>*
(
const
std
::
string
&
/*type*/
,
const
VariableNameMap
&
/*inputs*/
,
const
VariableNameMap
&
/*outputs*/
,
const
framework
::
AttributeMap
&
/*attrs*/
)
>
;
using
OpCreator
=
std
::
function
<
framework
::
OperatorBase
<
Dtype
>
*
(
const
std
::
string
&
/*type*/
,
const
VariableNameMap
&
/*inputs*/
,
const
VariableNameMap
&
/*outputs*/
,
const
framework
::
AttributeMap
&
/*attrs*/
)
>
;
using
GradOpMakerFN
=
std
::
function
<
std
::
vector
<
std
::
unique_ptr
<
framework
::
OpDesc
>>
(
const
framework
::
OpDesc
&
,
const
std
::
unordered_set
<
std
::
string
>&
/*no_grad_set*/
,
std
::
unordered_map
<
std
::
string
,
std
::
string
>*
/*grad_to_var*/
,
const
std
::
vector
<
framework
::
BlockDesc
*>&
grad_block
)
>
;
const
framework
::
OpDesc
&
,
const
std
::
unordered_set
<
std
::
string
>
&
/*no_grad_set*/
,
std
::
unordered_map
<
std
::
string
,
std
::
string
>
*
/*grad_to_var*/
,
const
std
::
vector
<
framework
::
BlockDesc
*>
&
grad_block
)
>
;
using
InferVarTypeFN
=
std
::
function
<
void
(
const
framework
::
OpDesc
&
/*op_desc*/
,
framework
::
BlockDesc
*
/*block*/
)
>
;
using
InferVarTypeFN
=
std
::
function
<
void
(
const
framework
::
OpDesc
&
/*op_desc*/
,
framework
::
BlockDesc
*
/*block*/
)
>
;
using
InferShapeFN
=
std
::
function
<
void
(
framework
::
InferShapeContext
*
)
>
;
using
InferShapeFN
=
std
::
function
<
void
(
framework
::
InferShapeContext
*
)
>
;
};
src/common/types.h
浏览文件 @
d2f8befa
...
...
@@ -24,8 +24,7 @@ enum class Precision : int { FP32 = 0 };
//! device type
enum
DeviceTypeEnum
{
kINVALID
=
-
1
,
kCPU
=
0
,
kFPGA
=
1
,
kGPU_MALI
=
2
};
template
<
DeviceTypeEnum
T
>
struct
DeviceType
{};
template
<
DeviceTypeEnum
T
>
struct
DeviceType
{};
typedef
DeviceType
<
kCPU
>
CPU
;
typedef
DeviceType
<
kFPGA
>
FPGA
;
...
...
src/common/variant.h
浏览文件 @
d2f8befa
...
...
@@ -21,13 +21,9 @@ SOFTWARE.
#pragma once
namespace
paddle_mobile
{
template
<
int
ID
,
typename
Type
>
struct
IDToType
{
typedef
Type
type_t
;
};
template
<
int
ID
,
typename
Type
>
struct
IDToType
{
typedef
Type
type_t
;
};
template
<
typename
F
,
typename
...
Ts
>
struct
VariantHelper
{
template
<
typename
F
,
typename
...
Ts
>
struct
VariantHelper
{
static
const
size_t
size
=
sizeof
(
F
)
>
VariantHelper
<
Ts
...
>::
size
?
sizeof
(
F
)
:
VariantHelper
<
Ts
...
>::
size
;
...
...
@@ -41,8 +37,7 @@ struct VariantHelper {
}
};
template
<
typename
F
>
struct
VariantHelper
<
F
>
{
template
<
typename
F
>
struct
VariantHelper
<
F
>
{
static
const
size_t
size
=
sizeof
(
F
);
inline
static
void
Destroy
(
size_t
id
,
void
*
data
)
{
if
(
id
==
typeid
(
F
).
hash_code
())
{
...
...
@@ -53,9 +48,8 @@ struct VariantHelper<F> {
}
};
template
<
size_t
size
>
class
RawData
{
public:
template
<
size_t
size
>
class
RawData
{
public:
char
data
[
size
];
RawData
()
{}
RawData
(
const
RawData
&
raw_data
)
{
strcpy
(
data
,
raw_data
.
data
);
}
...
...
@@ -64,8 +58,7 @@ class RawData {
// }
};
template
<
typename
...
Ts
>
struct
Variant
{
template
<
typename
...
Ts
>
struct
Variant
{
Variant
(
const
Variant
&
variant
)
{
// std::cout << " 赋值构造函数 " << std::endl;
type_id
=
variant
.
type_id
;
...
...
@@ -77,15 +70,13 @@ struct Variant {
// helper::Destroy(type_id, &data);
}
template
<
typename
T
,
typename
...
Args
>
void
Set
(
Args
&&
...
args
)
{
template
<
typename
T
,
typename
...
Args
>
void
Set
(
Args
&&
...
args
)
{
helper
::
Destroy
(
type_id
,
&
data
);
new
(
&
data
)
T
(
std
::
forward
<
Args
>
(
args
)...);
type_id
=
typeid
(
T
).
hash_code
();
}
template
<
typename
T
>
T
&
Get
()
const
{
template
<
typename
T
>
T
&
Get
()
const
{
if
(
type_id
==
typeid
(
T
).
hash_code
())
{
return
*
const_cast
<
T
*>
(
reinterpret_cast
<
const
T
*>
(
&
data
));
}
else
{
...
...
@@ -96,16 +87,13 @@ struct Variant {
size_t
TypeId
()
const
{
return
type_id
;
}
private:
private:
static
inline
size_t
invalid_type
()
{
return
typeid
(
void
).
hash_code
();
}
typedef
VariantHelper
<
Ts
...
>
helper
;
size_t
type_id
;
RawData
<
helper
::
size
>
data
;
};
template
<
typename
T
>
struct
Vistor
{
typedef
T
type_t
;
};
template
<
typename
T
>
struct
Vistor
{
typedef
T
type_t
;
};
}
// namespace paddle_mobile
}
// namespace paddle_mobile
src/framework/attribute.cpp
浏览文件 @
d2f8befa
...
...
@@ -20,4 +20,4 @@ SOFTWARE.
namespace
paddle_mobile
{
namespace
framework
{}
}
// namespace paddle_mobile
}
// namespace paddle_mobile
src/framework/attribute.h
浏览文件 @
d2f8befa
...
...
@@ -27,86 +27,82 @@ namespace framework {
class
BlockDesc
;
class
Attribute
{
public:
static
Attribute
GetAttrValue
(
const
proto
::
OpDesc
::
Attr
&
attr_desc
)
{
public:
static
Attribute
GetAttrValue
(
const
proto
::
OpDesc
::
Attr
&
attr_desc
)
{
// std::cout << "begin get attr value" << std::endl;
Attribute
attr
;
switch
(
attr_desc
.
type
())
{
case
proto
::
AttrType
::
BOOLEAN
:
{
attr
.
Set
<
bool
>
(
attr_desc
.
b
());
break
;
}
case
proto
::
AttrType
::
INT
:
{
attr
.
Set
<
int
>
(
attr_desc
.
i
());
break
;
}
case
proto
::
AttrType
::
FLOAT
:
{
attr
.
Set
<
float
>
(
attr_desc
.
f
());
break
;
}
case
proto
::
AttrType
::
STRING
:
{
attr
.
Set
<
std
::
string
>
(
attr_desc
.
s
());
break
;
}
case
proto
::
AttrType
::
BOOLEANS
:
{
std
::
vector
<
bool
>
val
(
attr_desc
.
bools_size
());
for
(
int
i
=
0
;
i
<
attr_desc
.
bools_size
();
++
i
)
{
val
[
i
]
=
attr_desc
.
bools
(
i
);
}
attr
.
Set
<
std
::
vector
<
bool
>>
(
val
);
break
;
}
case
proto
::
AttrType
::
INTS
:
{
std
::
vector
<
int
>
val
(
attr_desc
.
ints_size
());
for
(
int
i
=
0
;
i
<
attr_desc
.
ints_size
();
++
i
)
{
val
[
i
]
=
attr_desc
.
ints
(
i
);
}
attr
.
Set
<
std
::
vector
<
int
>>
(
val
);
break
;
case
proto
::
AttrType
::
BOOLEAN
:
{
attr
.
Set
<
bool
>
(
attr_desc
.
b
());
break
;
}
case
proto
::
AttrType
::
INT
:
{
attr
.
Set
<
int
>
(
attr_desc
.
i
());
break
;
}
case
proto
::
AttrType
::
FLOAT
:
{
attr
.
Set
<
float
>
(
attr_desc
.
f
());
break
;
}
case
proto
::
AttrType
::
STRING
:
{
attr
.
Set
<
std
::
string
>
(
attr_desc
.
s
());
break
;
}
case
proto
::
AttrType
::
BOOLEANS
:
{
std
::
vector
<
bool
>
val
(
attr_desc
.
bools_size
());
for
(
int
i
=
0
;
i
<
attr_desc
.
bools_size
();
++
i
)
{
val
[
i
]
=
attr_desc
.
bools
(
i
);
}
case
proto
::
AttrType
::
FLOATS
:
{
std
::
vector
<
float
>
val
(
attr_desc
.
floats_size
())
;
for
(
int
i
=
0
;
i
<
attr_desc
.
floats_size
();
++
i
)
{
val
[
i
]
=
attr_desc
.
floats
(
i
);
}
attr
.
Set
<
std
::
vector
<
float
>>
(
val
);
break
;
attr
.
Set
<
std
::
vector
<
bool
>>
(
val
);
break
;
}
case
proto
::
AttrType
::
INTS
:
{
std
::
vector
<
int
>
val
(
attr_desc
.
ints_size
());
for
(
int
i
=
0
;
i
<
attr_desc
.
ints_size
();
++
i
)
{
val
[
i
]
=
attr_desc
.
ints
(
i
)
;
}
case
proto
::
AttrType
::
STRINGS
:
{
std
::
vector
<
std
::
string
>
val
(
attr_desc
.
strings_size
())
;
for
(
int
i
=
0
;
i
<
attr_desc
.
strings_size
();
++
i
)
{
val
[
i
]
=
attr_desc
.
strings
(
i
);
}
attr
.
Set
<
std
::
vector
<
std
::
string
>>
(
val
);
break
;
attr
.
Set
<
std
::
vector
<
int
>>
(
val
);
break
;
}
case
proto
::
AttrType
::
FLOATS
:
{
std
::
vector
<
float
>
val
(
attr_desc
.
floats_size
());
for
(
int
i
=
0
;
i
<
attr_desc
.
floats_size
();
++
i
)
{
val
[
i
]
=
attr_desc
.
floats
(
i
)
;
}
case
proto
::
AttrType
::
LONG
:
{
attr
.
Set
<
int64_t
>
(
attr_desc
.
l
());
break
;
attr
.
Set
<
std
::
vector
<
float
>>
(
val
);
break
;
}
case
proto
::
AttrType
::
STRINGS
:
{
std
::
vector
<
std
::
string
>
val
(
attr_desc
.
strings_size
());
for
(
int
i
=
0
;
i
<
attr_desc
.
strings_size
();
++
i
)
{
val
[
i
]
=
attr_desc
.
strings
(
i
);
}
default:
// std::cout << " not support " << std::endl;
break
;
attr
.
Set
<
std
::
vector
<
std
::
string
>>
(
val
);
break
;
}
case
proto
::
AttrType
::
LONG
:
{
attr
.
Set
<
int64_t
>
(
attr_desc
.
l
());
break
;
}
default:
// std::cout << " not support " << std::endl;
break
;
}
// std::cout << "end get attr value" << std::endl;
return
attr
;
}
Attribute
()
{}
template
<
typename
T
,
typename
...
Args
>
Attribute
&
Set
(
Args
&&
...
args
)
{
template
<
typename
T
,
typename
...
Args
>
Attribute
&
Set
(
Args
&&
...
args
)
{
variant_
.
Set
<
T
>
(
args
...);
return
*
this
;
}
template
<
typename
T
>
T
&
Get
()
const
{
return
variant_
.
Get
<
T
>
();
}
template
<
typename
T
>
T
&
Get
()
const
{
return
variant_
.
Get
<
T
>
();
}
private:
private:
Variant
<
int
,
float
,
std
::
string
,
std
::
vector
<
int
>
,
std
::
vector
<
float
>
,
std
::
vector
<
std
::
string
>
,
bool
,
std
::
vector
<
bool
>
,
BlockDesc
*
,
std
::
vector
<
std
::
string
>
,
bool
,
std
::
vector
<
bool
>
,
BlockDesc
*
,
int64_t
>
variant_
;
};
...
...
@@ -114,20 +110,19 @@ class Attribute {
using
AttributeMap
=
std
::
unordered_map
<
std
::
string
,
Attribute
>
;
class
AttrReader
{
public:
explicit
AttrReader
(
const
AttributeMap
&
attrs
)
:
attrs_
(
attrs
)
{}
public:
explicit
AttrReader
(
const
AttributeMap
&
attrs
)
:
attrs_
(
attrs
)
{}
template
<
typename
T
>
inline
T
Get
(
const
std
::
string
&
name
)
const
{
template
<
typename
T
>
inline
T
Get
(
const
std
::
string
&
name
)
const
{
// PADDLE_ENFORCE(attrs_.count(name) != 0, "%s should be in
// AttributeMap",
// name);
return
((
Attribute
)
attrs_
.
at
(
name
)).
Get
<
T
>
();
}
private:
const
AttributeMap
&
attrs_
;
private:
const
AttributeMap
&
attrs_
;
};
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/framework/block_desc.cpp
浏览文件 @
d2f8befa
...
...
@@ -46,5 +46,5 @@ BlockDesc::BlockDesc(const proto::BlockDesc &desc) : desc_(desc) {
}
}
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/framework/block_desc.h
浏览文件 @
d2f8befa
...
...
@@ -27,7 +27,7 @@ namespace paddle_mobile {
namespace
framework
{
class
BlockDesc
:
PaddleMobileObject
{
public:
public:
BlockDesc
(
const
proto
::
BlockDesc
&
desc
);
const
int
&
ID
()
const
{
return
desc_
.
idx
();
}
...
...
@@ -45,19 +45,18 @@ class BlockDesc : PaddleMobileObject {
std
::
vector
<
std
::
shared_ptr
<
VarDesc
>>
Vars
()
const
;
std
::
vector
<
std
::
shared_ptr
<
OpDesc
>>
Ops
()
const
;
private:
private:
proto
::
BlockDesc
desc_
;
std
::
vector
<
std
::
shared_ptr
<
OpDesc
>>
ops_
;
std
::
unordered_map
<
std
::
string
,
std
::
shared_ptr
<
VarDesc
>>
vars_
;
};
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
namespace
std
{
template
<
>
struct
hash
<
paddle_mobile
::
framework
::
BlockDesc
>
{
template
<
>
struct
hash
<
paddle_mobile
::
framework
::
BlockDesc
>
{
typedef
paddle_mobile
::
framework
::
BlockDesc
argument_type
;
typedef
std
::
size_t
result_type
;
result_type
operator
()(
argument_type
const
&
s
)
const
noexcept
{
...
...
@@ -67,4 +66,4 @@ struct hash<paddle_mobile::framework::BlockDesc> {
}
};
}
// namespace std
}
// namespace std
src/framework/data_layout.h
浏览文件 @
d2f8befa
...
...
@@ -27,7 +27,7 @@ enum class DataLayout {
kAnyLayout
=
2
,
};
inline
DataLayout
StringToDataLayout
(
const
std
::
string
&
str
)
{
inline
DataLayout
StringToDataLayout
(
const
std
::
string
&
str
)
{
std
::
string
s
(
str
);
for
(
size_t
i
=
0
;
i
<
s
.
size
();
++
i
)
{
s
[
i
]
=
toupper
(
s
[
i
]);
...
...
@@ -44,24 +44,24 @@ inline DataLayout StringToDataLayout(const std::string& str) {
}
}
inline
std
::
string
DataLayoutToString
(
const
DataLayout
&
data_layout
)
{
inline
std
::
string
DataLayoutToString
(
const
DataLayout
&
data_layout
)
{
switch
(
data_layout
)
{
case
DataLayout
::
kNHWC
:
return
"NHWC"
;
case
DataLayout
::
kNCHW
:
return
"NCHW"
;
case
DataLayout
::
kAnyLayout
:
return
"ANY_LAYOUT"
;
default:
break
;
// std::cout << "unknown DataLayou %d", data_layout;
case
DataLayout
::
kNHWC
:
return
"NHWC"
;
case
DataLayout
::
kNCHW
:
return
"NCHW"
;
case
DataLayout
::
kAnyLayout
:
return
"ANY_LAYOUT"
;
default:
break
;
// std::cout << "unknown DataLayou %d", data_layout;
}
}
inline
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
DataLayout
&
l
)
{
inline
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
DataLayout
&
l
)
{
out
<<
DataLayoutToString
(
l
);
return
out
;
}
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/framework/data_transform.cpp
浏览文件 @
d2f8befa
...
...
@@ -23,14 +23,14 @@ SOFTWARE.
namespace
paddle_mobile
{
namespace
framework
{
static
void
PassTensorData
(
Tensor
*
from
,
Tensor
*
to
)
{
static
void
PassTensorData
(
Tensor
*
from
,
Tensor
*
to
)
{
to
->
ShareDataWith
(
*
from
);
*
from
=
Tensor
();
}
void
DataTransform
(
const
OpKernelType
&
expected_kernel_type
,
const
OpKernelType
&
kernel_type_for_var
,
const
Tensor
&
input_tensor
,
Tensor
*
output_tensor
)
{
void
DataTransform
(
const
OpKernelType
&
expected_kernel_type
,
const
OpKernelType
&
kernel_type_for_var
,
const
Tensor
&
input_tensor
,
Tensor
*
output_tensor
)
{
bool
transformed
=
false
;
Tensor
in
;
in
.
ShareDataWith
(
input_tensor
);
...
...
@@ -64,8 +64,8 @@ void DataTransform(const OpKernelType& expected_kernel_type,
output_tensor
->
ShareDataWith
(
in
);
}
void
CopyVariableWithTensor
(
const
Variable
&
in_var
,
const
Tensor
&
tensor
,
Variable
&
out_var
)
{
void
CopyVariableWithTensor
(
const
Variable
&
in_var
,
const
Tensor
&
tensor
,
Variable
&
out_var
)
{
// if (in_var.IsType<LoDTensor>()) {
// auto& in_lod_tensor = in_var.Get<LoDTensor>();
// auto* tran_lod_tensor = out_var.GetMutable<LoDTensor>();
...
...
@@ -83,5 +83,5 @@ void CopyVariableWithTensor(const Variable& in_var, const Tensor& tensor,
// }
}
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/framework/data_transform.h
浏览文件 @
d2f8befa
...
...
@@ -30,12 +30,12 @@ SOFTWARE.
namespace
paddle_mobile
{
namespace
framework
{
void
DataTransform
(
const
OpKernelType
&
expected_kernel_type
,
const
OpKernelType
&
kernel_type_for_var
,
const
Tensor
&
input_tensor
,
Tensor
*
out
);
void
DataTransform
(
const
OpKernelType
&
expected_kernel_type
,
const
OpKernelType
&
kernel_type_for_var
,
const
Tensor
&
input_tensor
,
Tensor
*
out
);
void
CopyVariableWithTensor
(
const
Variable
&
in_var
,
const
Tensor
&
tensor
,
Variable
&
out_var
);
void
CopyVariableWithTensor
(
const
Variable
&
in_var
,
const
Tensor
&
tensor
,
Variable
&
out_var
);
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/framework/data_type.h
浏览文件 @
d2f8befa
...
...
@@ -40,4 +40,4 @@ namespace framework {
// }
// }
}
}
// namespace paddle_mobile
}
// namespace paddle_mobile
src/framework/ddim.cc
浏览文件 @
d2f8befa
...
...
@@ -19,52 +19,48 @@ namespace framework {
/// @cond HIDDEN
template
<
int
i
>
Dim
<
i
>
make_dim
(
const
int64_t
*
d
)
{
template
<
int
i
>
Dim
<
i
>
make_dim
(
const
int64_t
*
d
)
{
return
Dim
<
i
>
(
*
d
,
make_dim
<
i
-
1
>
(
d
+
1
));
}
template
<
>
Dim
<
0
>
make_dim
<
0
>
(
const
int64_t
*
d
)
{
return
Dim
<
0
>
(
*
d
);
}
template
<
>
Dim
<
0
>
make_dim
<
0
>
(
const
int64_t
*
d
)
{
return
Dim
<
0
>
(
*
d
);
}
void
make_ddim
(
DDim
&
ddim
,
const
int64_t
*
dims
,
int
n
)
{
void
make_ddim
(
DDim
&
ddim
,
const
int64_t
*
dims
,
int
n
)
{
switch
(
n
)
{
case
0
:
ddim
=
make_dim
<
0
>
(
dims
);
break
;
case
1
:
ddim
=
make_dim
<
1
>
(
dims
);
break
;
case
2
:
ddim
=
make_dim
<
2
>
(
dims
);
break
;
case
3
:
ddim
=
make_dim
<
3
>
(
dims
);
break
;
case
4
:
ddim
=
make_dim
<
4
>
(
dims
);
break
;
case
5
:
ddim
=
make_dim
<
5
>
(
dims
);
break
;
case
6
:
ddim
=
make_dim
<
6
>
(
dims
);
break
;
case
7
:
ddim
=
make_dim
<
7
>
(
dims
);
break
;
case
8
:
ddim
=
make_dim
<
8
>
(
dims
);
break
;
case
9
:
ddim
=
make_dim
<
9
>
(
dims
);
break
;
default:
// std::cout << "Dynamic dimensions must have between [1, 9]
// dimensions.";
break
;
case
0
:
ddim
=
make_dim
<
0
>
(
dims
);
break
;
case
1
:
ddim
=
make_dim
<
1
>
(
dims
);
break
;
case
2
:
ddim
=
make_dim
<
2
>
(
dims
);
break
;
case
3
:
ddim
=
make_dim
<
3
>
(
dims
);
break
;
case
4
:
ddim
=
make_dim
<
4
>
(
dims
);
break
;
case
5
:
ddim
=
make_dim
<
5
>
(
dims
);
break
;
case
6
:
ddim
=
make_dim
<
6
>
(
dims
);
break
;
case
7
:
ddim
=
make_dim
<
7
>
(
dims
);
break
;
case
8
:
ddim
=
make_dim
<
8
>
(
dims
);
break
;
case
9
:
ddim
=
make_dim
<
9
>
(
dims
);
break
;
default:
// std::cout << "Dynamic dimensions must have between [1, 9]
// dimensions.";
break
;
}
}
...
...
@@ -76,13 +72,13 @@ DDim make_ddim(std::initializer_list<int64_t> dims) {
return
result
;
}
DDim
make_ddim
(
const
std
::
vector
<
int64_t
>
&
dims
)
{
DDim
make_ddim
(
const
std
::
vector
<
int64_t
>
&
dims
)
{
DDim
result
(
make_dim
(
0
));
make_ddim
(
result
,
&
dims
[
0
],
dims
.
size
());
return
result
;
}
DDim
make_ddim
(
const
std
::
vector
<
int
>
&
dims
)
{
DDim
make_ddim
(
const
std
::
vector
<
int
>
&
dims
)
{
std
::
vector
<
int64_t
>
res
(
dims
.
size
());
std
::
transform
(
dims
.
begin
(),
dims
.
end
(),
res
.
begin
(),
[](
int
d
)
{
return
static_cast
<
int64_t
>
(
d
);
});
...
...
@@ -91,35 +87,31 @@ DDim make_ddim(const std::vector<int>& dims) {
/// @cond HIDDEN
// XXX For some reason, putting this in an anonymous namespace causes errors
struct
DynamicMutableIndexer
:
Vistor
<
int64_t
&>
{
public:
struct
DynamicMutableIndexer
:
Vistor
<
int64_t
&>
{
public:
explicit
DynamicMutableIndexer
(
int
idx
)
:
idx_
(
idx
)
{}
template
<
int
D
>
int64_t
&
operator
()(
Dim
<
D
>&
dim
)
const
{
return
dim
[
idx_
];
}
template
<
int
D
>
int64_t
&
operator
()(
Dim
<
D
>
&
dim
)
const
{
return
dim
[
idx_
];
}
private:
private:
int
idx_
;
};
struct
DynamicConstIndexer
:
public
Vistor
<
int64_t
>
{
public:
public:
explicit
DynamicConstIndexer
(
int
idx
)
:
idx_
(
idx
)
{}
template
<
int
D
>
int64_t
operator
()(
const
Dim
<
D
>&
dim
)
const
{
template
<
int
D
>
int64_t
operator
()(
const
Dim
<
D
>
&
dim
)
const
{
return
dim
[
idx_
];
}
private:
private:
int
idx_
;
};
/// @endcond
int64_t
&
DDim
::
operator
[](
int
idx
)
{
int64_t
&
DDim
::
operator
[](
int
idx
)
{
return
DDim
::
ApplyVistor
(
DynamicMutableIndexer
(
idx
),
*
this
);
}
...
...
@@ -178,27 +170,26 @@ DDim DDim::operator*(DDim d) const {
return
make_ddim
(
v3
);
}
int64_t
get
(
const
DDim
&
ddim
,
int
idx
)
{
return
ddim
[
idx
];
}
int64_t
get
(
const
DDim
&
ddim
,
int
idx
)
{
return
ddim
[
idx
];
}
void
set
(
DDim
&
ddim
,
int
idx
,
int
value
)
{
ddim
[
idx
]
=
value
;
}
void
set
(
DDim
&
ddim
,
int
idx
,
int
value
)
{
ddim
[
idx
]
=
value
;
}
/// @cond HIDDEN
struct
VectorizeVisitor
:
Vistor
<
void
>
{
std
::
vector
<
int64_t
>
&
vector
;
std
::
vector
<
int64_t
>
&
vector
;
explicit
VectorizeVisitor
(
std
::
vector
<
int64_t
>
&
v
)
:
vector
(
v
)
{}
explicit
VectorizeVisitor
(
std
::
vector
<
int64_t
>
&
v
)
:
vector
(
v
)
{}
template
<
typename
T
>
void
operator
()(
const
T
&
t
)
{
template
<
typename
T
>
void
operator
()(
const
T
&
t
)
{
vector
.
push_back
(
t
.
head
);
this
->
operator
()(
t
.
tail
);
}
void
operator
()(
const
Dim
<
0
>
&
t
)
{}
void
operator
()(
const
Dim
<
0
>
&
t
)
{}
};
/// @endcond
std
::
vector
<
int64_t
>
vectorize
(
const
DDim
&
ddim
)
{
std
::
vector
<
int64_t
>
vectorize
(
const
DDim
&
ddim
)
{
std
::
vector
<
int64_t
>
result
;
VectorizeVisitor
visitor
(
result
);
DDim
::
ApplyVistor
(
visitor
,
ddim
);
...
...
@@ -207,30 +198,29 @@ std::vector<int64_t> vectorize(const DDim& ddim) {
// NOTE: framework::vectorize converts to type int64_t
// which does not fit cudnn inputs.
std
::
vector
<
int
>
vectorize2int
(
const
DDim
&
ddim
)
{
std
::
vector
<
int
>
vectorize2int
(
const
DDim
&
ddim
)
{
std
::
vector
<
int64_t
>
temp
=
vectorize
(
ddim
);
std
::
vector
<
int
>
result
(
temp
.
begin
(),
temp
.
end
());
return
result
;
}
struct
ProductVisitor
:
Vistor
<
int64_t
>
{
template
<
int
D
>
int64_t
operator
()(
const
Dim
<
D
>&
dim
)
{
template
<
int
D
>
int64_t
operator
()(
const
Dim
<
D
>
&
dim
)
{
return
product
(
dim
);
}
};
int64_t
product
(
const
DDim
&
ddim
)
{
int64_t
product
(
const
DDim
&
ddim
)
{
ProductVisitor
visitor
;
return
DDim
::
ApplyVistor
(
visitor
,
ddim
);
}
struct
SliceVectorizeVisitor
:
Vistor
<
void
>
{
std
::
vector
<
int64_t
>
&
vector
;
std
::
vector
<
int64_t
>
&
vector
;
int
begin
;
int
end
;
SliceVectorizeVisitor
(
std
::
vector
<
int64_t
>
&
v
,
int
b
,
int
e
)
SliceVectorizeVisitor
(
std
::
vector
<
int64_t
>
&
v
,
int
b
,
int
e
)
:
vector
(
v
),
begin
(
b
),
end
(
e
)
{
// PADDLE_ENFORCE(begin < end,
// "Begin index must be less than end index in ddim
...
...
@@ -239,8 +229,7 @@ struct SliceVectorizeVisitor : Vistor<void> {
// "Begin index can't be less than zero in ddim slice.");
}
template
<
int
S
>
void
operator
()(
const
Dim
<
S
>&
dim
)
{
template
<
int
S
>
void
operator
()(
const
Dim
<
S
>
&
dim
)
{
if
(
begin
==
0
)
{
vector
.
push_back
(
dim
.
head
);
}
else
{
...
...
@@ -252,12 +241,12 @@ struct SliceVectorizeVisitor : Vistor<void> {
}
}
void
operator
()(
const
Dim
<
0
>
&
dim
)
{
void
operator
()(
const
Dim
<
0
>
&
dim
)
{
// PADDLE_ENFORCE(end == 0, "End index in ddim slice is out of bound.");
}
};
DDim
slice_ddim
(
const
DDim
&
ddim
,
int
begin
,
int
end
)
{
DDim
slice_ddim
(
const
DDim
&
ddim
,
int
begin
,
int
end
)
{
std
::
vector
<
int64_t
>
vec
;
vec
.
reserve
(
end
-
begin
);
SliceVectorizeVisitor
visitor
(
vec
,
begin
,
end
);
...
...
@@ -270,15 +259,12 @@ DDim slice_ddim(const DDim& ddim, int begin, int end) {
/// \cond HIDDEN
struct
ArityVisitor
:
Vistor
<
int
>
{
template
<
int
D
>
int
operator
()(
Dim
<
D
>
)
const
{
return
D
;
}
template
<
int
D
>
int
operator
()(
Dim
<
D
>
)
const
{
return
D
;
}
};
/// \endcond
int
arity
(
const
DDim
&
d
)
{
int
arity
(
const
DDim
&
d
)
{
ArityVisitor
arityVisitor
=
ArityVisitor
();
return
DDim
::
ApplyVistor
(
arityVisitor
,
d
);
// return arityVisitor(d.var.Get<Dim<4>>());
...
...
@@ -288,19 +274,18 @@ int arity(const DDim& d) {
/// \endcond
struct
OSVistor
:
Vistor
<
std
::
ostream
&>
{
OSVistor
(
std
::
ostream
&
os
)
:
os_
(
os
)
{}
struct
OSVistor
:
Vistor
<
std
::
ostream
&>
{
OSVistor
(
std
::
ostream
&
os
)
:
os_
(
os
)
{}
template
<
int
D
>
std
::
ostream
&
operator
()(
Dim
<
D
>
dim
)
const
{
template
<
int
D
>
std
::
ostream
&
operator
()(
Dim
<
D
>
dim
)
const
{
return
os_
<<
dim
;
}
private:
std
::
ostream
&
os_
;
private:
std
::
ostream
&
os_
;
};
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
DDim
&
ddim
)
{
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
DDim
&
ddim
)
{
auto
vistor
=
OSVistor
(
os
);
DDim
::
ApplyVistor
(
vistor
,
ddim
);
return
os
;
...
...
@@ -310,15 +295,15 @@ DDim::DDim(std::initializer_list<int64_t> init_list) {
*
this
=
make_ddim
(
init_list
);
}
DDim
flatten_to_2d
(
const
DDim
&
src
,
int
num_col_dims
)
{
DDim
flatten_to_2d
(
const
DDim
&
src
,
int
num_col_dims
)
{
int
rank
=
src
.
size
();
return
make_ddim
({
product
(
slice_ddim
(
src
,
0
,
num_col_dims
)),
product
(
slice_ddim
(
src
,
num_col_dims
,
rank
))});
}
DDim
flatten_to_1d
(
const
DDim
&
src
)
{
return
make_ddim
({
product
(
src
)});
}
DDim
flatten_to_1d
(
const
DDim
&
src
)
{
return
make_ddim
({
product
(
src
)});
}
DDim
stride
(
const
DDim
&
ddim
)
{
DDim
stride
(
const
DDim
&
ddim
)
{
std
::
vector
<
int64_t
>
strides
(
ddim
.
size
());
strides
[
ddim
.
size
()
-
1
]
=
1
;
for
(
int
i
=
ddim
.
size
()
-
2
;
i
>=
0
;
--
i
)
{
...
...
@@ -327,7 +312,7 @@ DDim stride(const DDim& ddim) {
return
framework
::
make_ddim
(
strides
);
}
DDim
stride_numel
(
const
framework
::
DDim
&
ddim
)
{
DDim
stride_numel
(
const
framework
::
DDim
&
ddim
)
{
std
::
vector
<
int64_t
>
strides
(
ddim
.
size
());
strides
[
ddim
.
size
()
-
1
]
=
ddim
[
ddim
.
size
()
-
1
];
for
(
int
i
=
ddim
.
size
()
-
2
;
i
>=
0
;
--
i
)
{
...
...
@@ -336,5 +321,5 @@ DDim stride_numel(const framework::DDim& ddim) {
return
framework
::
make_ddim
(
strides
);
}
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/framework/ddim.h
浏览文件 @
d2f8befa
...
...
@@ -14,12 +14,12 @@ limitations under the License. */
#pragma once
#include "common/variant.h"
#include "dim.h"
#include <assert.h>
#include <initializer_list>
#include <stdexcept>
#include <vector>
#include "common/variant.h"
#include "dim.h"
namespace
paddle_mobile
{
namespace
framework
{
...
...
@@ -66,15 +66,11 @@ struct DDim {
DDim
()
{
var
.
Set
<
Dim
<
1
>>
(
Dim
<
1
>
());
}
template
<
int
D
>
explicit
DDim
(
const
Dim
<
D
>
&
in
)
{
var
.
Set
<
Dim
<
D
>>
(
in
);
}
template
<
int
D
>
explicit
DDim
(
const
Dim
<
D
>
&
in
)
{
var
.
Set
<
Dim
<
D
>>
(
in
);
}
/*implicit*/
DDim
(
std
::
initializer_list
<
int64_t
>
init_list
);
template
<
int
D
>
DDim
&
operator
=
(
const
Dim
<
D
>
&
in
)
{
template
<
int
D
>
DDim
&
operator
=
(
const
Dim
<
D
>
&
in
)
{
var
.
Set
<
Dim
<
D
>>
(
in
);
return
*
this
;
}
...
...
@@ -161,5 +157,5 @@ DDim flatten_to_1d(const DDim &src);
DDim
stride
(
const
DDim
&
ddim
);
DDim
stride_numel
(
const
DDim
&
ddim
);
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/framework/dim.h
浏览文件 @
d2f8befa
...
...
@@ -24,8 +24,7 @@ namespace paddle_mobile {
namespace
framework
{
// Statically sized, statically indexed dimension
template
<
int
i
>
struct
Dim
{
template
<
int
i
>
struct
Dim
{
static
constexpr
int
dimensions
=
i
;
template
<
typename
...
Args
>
...
...
@@ -35,7 +34,7 @@ struct Dim {
}
HOSTDEVICE
Dim
(
int64_t
_head
,
const
Dim
<
i
-
1
>
&
_tail
)
:
head
(
_head
),
tail
(
_tail
)
{}
Dim
(
int64_t
_head
,
const
Dim
<
i
-
1
>
&
_tail
)
:
head
(
_head
),
tail
(
_tail
)
{}
HOSTDEVICE
Dim
()
:
head
(
0
),
tail
()
{}
...
...
@@ -43,7 +42,7 @@ struct Dim {
/** Construct a Dim from a linear index and size. Uses Fortran order
* indexing. */
HOSTDEVICE
Dim
(
int64_t
idx
,
const
Dim
<
i
>
&
size
)
Dim
(
int64_t
idx
,
const
Dim
<
i
>
&
size
)
:
head
(
idx
%
size
.
head
),
tail
(
idx
/
size
.
head
,
size
.
tail
)
{}
/** Construct a Dim with each dimension set to the given index */
...
...
@@ -51,15 +50,15 @@ struct Dim {
Dim
(
int64_t
idx
)
:
head
(
idx
),
tail
(
idx
)
{}
HOSTDEVICE
bool
operator
==
(
const
Dim
<
i
>
&
o
)
const
{
bool
operator
==
(
const
Dim
<
i
>
&
o
)
const
{
return
(
head
==
o
.
head
)
&&
(
tail
==
o
.
tail
);
}
HOSTDEVICE
bool
operator
!=
(
const
Dim
<
i
>
&
o
)
const
{
return
!
(
*
this
==
o
);
}
bool
operator
!=
(
const
Dim
<
i
>
&
o
)
const
{
return
!
(
*
this
==
o
);
}
HOSTDEVICE
int64_t
&
operator
[](
int
idx
);
int64_t
&
operator
[](
int
idx
);
HOSTDEVICE
int64_t
operator
[](
int
idx
)
const
;
...
...
@@ -70,8 +69,7 @@ struct Dim {
};
// Base case specialization
template
<
>
struct
Dim
<
0
>
{
template
<
>
struct
Dim
<
0
>
{
static
constexpr
int
dimensions
=
0
;
HOSTDEVICE
...
...
@@ -81,7 +79,7 @@ struct Dim<0> {
Dim
()
{}
HOSTDEVICE
Dim
(
int
idx
,
const
Dim
<
0
>
&
size
)
{
Dim
(
int
idx
,
const
Dim
<
0
>
&
size
)
{
#ifndef __CUDA_ARCH__
if
(
idx
>
0
)
{
throw
std
::
invalid_argument
(
"Index out of range."
);
...
...
@@ -92,13 +90,13 @@ struct Dim<0> {
}
HOSTDEVICE
bool
operator
==
(
const
Dim
<
0
>
&
o
)
const
{
return
true
;
}
bool
operator
==
(
const
Dim
<
0
>
&
o
)
const
{
return
true
;
}
HOSTDEVICE
bool
operator
!=
(
const
Dim
<
0
>
&
o
)
const
{
return
false
;
}
bool
operator
!=
(
const
Dim
<
0
>
&
o
)
const
{
return
false
;
}
HOSTDEVICE
int64_t
&
operator
[](
int
idx
);
int64_t
&
operator
[](
int
idx
);
HOSTDEVICE
int64_t
operator
[](
int
idx
)
const
;
};
...
...
@@ -106,37 +104,28 @@ struct Dim<0> {
namespace
{
// Helper for accessing Dim classes
template
<
int
i
>
struct
DimGetter
{
template
<
int
i
>
struct
DimGetter
{
// Return a copy if Dim is const
template
<
typename
D
>
HOSTDEVICE
static
int64_t
impl
(
const
D
&
d
)
{
template
<
typename
D
>
HOSTDEVICE
static
int64_t
impl
(
const
D
&
d
)
{
return
DimGetter
<
i
-
1
>::
impl
(
d
.
tail
);
}
// Return a reference if Dim is mutable
template
<
typename
D
>
HOSTDEVICE
static
int64_t
&
impl
(
D
&
d
)
{
template
<
typename
D
>
HOSTDEVICE
static
int64_t
&
impl
(
D
&
d
)
{
return
DimGetter
<
i
-
1
>::
impl
(
d
.
tail
);
}
};
// Eureka! We found the element!
template
<
>
struct
DimGetter
<
0
>
{
template
<
>
struct
DimGetter
<
0
>
{
// Return a copy if Dim is const
template
<
typename
D
>
HOSTDEVICE
static
int64_t
impl
(
const
D
&
d
)
{
template
<
typename
D
>
HOSTDEVICE
static
int64_t
impl
(
const
D
&
d
)
{
return
d
.
head
;
}
// Return a reference if Dim is mutable
template
<
typename
D
>
HOSTDEVICE
static
int64_t
&
impl
(
D
&
d
)
{
return
d
.
head
;
}
template
<
typename
D
>
HOSTDEVICE
static
int64_t
&
impl
(
D
&
d
)
{
return
d
.
head
;
}
};
template
<
int
D
>
HOSTDEVICE
int64_t
&
indexer
(
Dim
<
D
>&
dim
,
int
idx
)
{
template
<
int
D
>
HOSTDEVICE
int64_t
&
indexer
(
Dim
<
D
>
&
dim
,
int
idx
)
{
#ifndef __CUDA_ARCH__
if
(
idx
<
0
)
{
throw
std
::
invalid_argument
(
"Tried to access a negative dimension"
);
...
...
@@ -150,8 +139,7 @@ HOSTDEVICE int64_t& indexer(Dim<D>& dim, int idx) {
return
indexer
(
dim
.
tail
,
idx
-
1
);
}
template
<
>
HOSTDEVICE
int64_t
&
indexer
<
0
>
(
Dim
<
0
>&
dim
,
int
idx
)
{
template
<
>
HOSTDEVICE
int64_t
&
indexer
<
0
>
(
Dim
<
0
>
&
dim
,
int
idx
)
{
#ifndef __CUDA_ARCH__
throw
std
::
invalid_argument
(
"Invalid index"
);
#else
...
...
@@ -167,8 +155,7 @@ HOSTDEVICE int64_t& indexer<0>(Dim<0>& dim, int idx) {
#endif
}
template
<
int
D
>
HOSTDEVICE
int64_t
indexer
(
const
Dim
<
D
>&
dim
,
int
idx
)
{
template
<
int
D
>
HOSTDEVICE
int64_t
indexer
(
const
Dim
<
D
>
&
dim
,
int
idx
)
{
#ifndef __CUDA_ARCH__
if
(
idx
<
0
)
{
throw
std
::
invalid_argument
(
"Tried to access a negative dimension"
);
...
...
@@ -182,8 +169,7 @@ HOSTDEVICE int64_t indexer(const Dim<D>& dim, int idx) {
return
indexer
(
dim
.
tail
,
idx
-
1
);
}
template
<
>
HOSTDEVICE
int64_t
indexer
<
0
>
(
const
Dim
<
0
>&
dim
,
int
idx
)
{
template
<
>
HOSTDEVICE
int64_t
indexer
<
0
>
(
const
Dim
<
0
>
&
dim
,
int
idx
)
{
#ifndef __CUDA_ARCH__
throw
std
::
invalid_argument
(
"Invalid index"
);
#else
...
...
@@ -199,29 +185,25 @@ HOSTDEVICE int64_t indexer<0>(const Dim<0>& dim, int idx) {
#endif
}
}
// namespace
}
// namespace
// Static access to constant Dim
template
<
int
i
,
int
l
>
HOSTDEVICE
int64_t
get
(
const
Dim
<
l
>&
d
)
{
template
<
int
i
,
int
l
>
HOSTDEVICE
int64_t
get
(
const
Dim
<
l
>
&
d
)
{
return
DimGetter
<
i
>::
impl
(
d
);
}
// Static access to mutable Dim
template
<
int
i
,
int
l
>
HOSTDEVICE
int64_t
&
get
(
Dim
<
l
>&
d
)
{
template
<
int
i
,
int
l
>
HOSTDEVICE
int64_t
&
get
(
Dim
<
l
>
&
d
)
{
return
DimGetter
<
i
>::
impl
(
d
);
}
// Dynamic access to constant Dim
template
<
int
l
>
HOSTDEVICE
int64_t
Dim
<
l
>::
operator
[](
int
i
)
const
{
template
<
int
l
>
HOSTDEVICE
int64_t
Dim
<
l
>::
operator
[](
int
i
)
const
{
// std::cout << "l: " << l << std::endl;
return
indexer
(
*
this
,
i
);
}
// Dynamic access to mutable Dim
template
<
int
l
>
HOSTDEVICE
int64_t
&
Dim
<
l
>::
operator
[](
int
i
)
{
template
<
int
l
>
HOSTDEVICE
int64_t
&
Dim
<
l
>::
operator
[](
int
i
)
{
return
indexer
(
*
this
,
i
);
}
...
...
@@ -231,54 +213,52 @@ inline HOSTDEVICE int64_t Dim<0>::operator[](int i) const {
}
// Dynamic access to mutable Dim
inline
HOSTDEVICE
int64_t
&
Dim
<
0
>::
operator
[](
int
i
)
{
inline
HOSTDEVICE
int64_t
&
Dim
<
0
>::
operator
[](
int
i
)
{
return
indexer
(
*
this
,
i
);
}
// Dynamic access to constant Dim
// without std::enable_if will try to instantiate this on get<0>(d)
template
<
int
l
>
HOSTDEVICE
typename
std
::
enable_if
<
(
l
>
0
),
int64_t
>::
type
get
(
const
Dim
<
l
>
&
d
,
HOSTDEVICE
typename
std
::
enable_if
<
(
l
>
0
),
int64_t
>::
type
get
(
const
Dim
<
l
>
&
d
,
int
i
)
{
return
d
[
i
];
}
// Dynamic access to mutable Dim
template
<
int
l
>
HOSTDEVICE
typename
std
::
enable_if
<
(
l
>
0
),
int64_t
&>::
type
get
(
Dim
<
l
>&
d
,
int
i
)
{
HOSTDEVICE
typename
std
::
enable_if
<
(
l
>
0
),
int64_t
&>::
type
get
(
Dim
<
l
>
&
d
,
int
i
)
{
return
d
[
i
];
}
// Dot product of two dims
template
<
int
i
>
HOSTDEVICE
int64_t
linearize
(
const
Dim
<
i
>
&
a
,
const
Dim
<
i
>&
b
)
{
HOSTDEVICE
int64_t
linearize
(
const
Dim
<
i
>
&
a
,
const
Dim
<
i
>
&
b
)
{
return
a
.
head
*
b
.
head
+
linearize
(
a
.
tail
,
b
.
tail
);
}
// Base case dot product of two Dims
// Notice it is inline because it is no longer a template
template
<
>
HOSTDEVICE
inline
int64_t
linearize
(
const
Dim
<
0
>
&
a
,
const
Dim
<
0
>&
b
)
{
HOSTDEVICE
inline
int64_t
linearize
(
const
Dim
<
0
>
&
a
,
const
Dim
<
0
>
&
b
)
{
return
0
;
}
// Product of a Dim
template
<
int
i
>
HOSTDEVICE
int64_t
product
(
const
Dim
<
i
>&
a
,
int
prod
=
1
)
{
template
<
int
i
>
HOSTDEVICE
int64_t
product
(
const
Dim
<
i
>
&
a
,
int
prod
=
1
)
{
return
prod
*
a
.
head
*
product
(
a
.
tail
);
}
// Base case product of a Dim
// Notice it is inline because it is no longer a template
template
<
>
HOSTDEVICE
inline
int64_t
product
(
const
Dim
<
0
>&
a
,
int
prod
)
{
template
<
>
HOSTDEVICE
inline
int64_t
product
(
const
Dim
<
0
>
&
a
,
int
prod
)
{
return
prod
;
}
// Is 0 <= idx_i < size_i for all i?
template
<
int
i
>
HOSTDEVICE
bool
contained
(
const
Dim
<
i
>
&
idx
,
const
Dim
<
i
>&
size
)
{
HOSTDEVICE
bool
contained
(
const
Dim
<
i
>
&
idx
,
const
Dim
<
i
>
&
size
)
{
return
((
0
<=
idx
.
head
)
&&
(
idx
.
head
<
size
.
head
)
&&
contained
(
idx
.
tail
,
size
.
tail
));
}
...
...
@@ -286,7 +266,7 @@ HOSTDEVICE bool contained(const Dim<i>& idx, const Dim<i>& size) {
// Base case of is 0 <= idx_i < size_i ?
// Notice it is inline because it is no longer a template
template
<
>
HOSTDEVICE
inline
bool
contained
(
const
Dim
<
0
>
&
idx
,
const
Dim
<
0
>&
size
)
{
HOSTDEVICE
inline
bool
contained
(
const
Dim
<
0
>
&
idx
,
const
Dim
<
0
>
&
size
)
{
return
true
;
}
...
...
@@ -294,15 +274,14 @@ HOSTDEVICE inline bool contained(const Dim<0>& idx, const Dim<0>& size) {
* \brief Compute exclusive prefix-multiply of a Dim.
*/
template
<
int
i
>
HOSTDEVICE
Dim
<
i
>
ex_prefix_mul
(
const
Dim
<
i
>
&
src
,
int
mul
=
1
)
{
HOSTDEVICE
Dim
<
i
>
ex_prefix_mul
(
const
Dim
<
i
>
&
src
,
int
mul
=
1
)
{
return
Dim
<
i
>
(
mul
,
ex_prefix_mul
(
src
.
tail
,
mul
*
src
.
head
));
}
///\cond HIDDEN
// Base case of ex_prefix_mul
// Notice it is inline because it is no longer a template
template
<
>
HOSTDEVICE
inline
Dim
<
0
>
ex_prefix_mul
(
const
Dim
<
0
>&
src
,
int
mul
)
{
template
<
>
HOSTDEVICE
inline
Dim
<
0
>
ex_prefix_mul
(
const
Dim
<
0
>
&
src
,
int
mul
)
{
return
Dim
<
0
>
();
}
///\endcond
...
...
@@ -310,38 +289,36 @@ HOSTDEVICE inline Dim<0> ex_prefix_mul(const Dim<0>& src, int mul) {
/**
* Add two dimensions together
*/
template
<
int
i
>
HOSTDEVICE
Dim
<
i
>
dim_plus
(
const
Dim
<
i
>&
a
,
const
Dim
<
i
>&
b
)
{
template
<
int
i
>
HOSTDEVICE
Dim
<
i
>
dim_plus
(
const
Dim
<
i
>
&
a
,
const
Dim
<
i
>
&
b
)
{
return
Dim
<
i
>
(
a
.
head
+
b
.
head
,
dim_plus
(
a
.
tail
,
b
.
tail
));
}
// Base case
template
<
>
HOSTDEVICE
inline
Dim
<
0
>
dim_plus
(
const
Dim
<
0
>
&
a
,
const
Dim
<
0
>&
b
)
{
HOSTDEVICE
inline
Dim
<
0
>
dim_plus
(
const
Dim
<
0
>
&
a
,
const
Dim
<
0
>
&
b
)
{
return
Dim
<
0
>
();
}
template
<
int
i
>
HOSTDEVICE
Dim
<
i
>
operator
+
(
const
Dim
<
i
>
&
lhs
,
const
Dim
<
i
>&
rhs
)
{
HOSTDEVICE
Dim
<
i
>
operator
+
(
const
Dim
<
i
>
&
lhs
,
const
Dim
<
i
>
&
rhs
)
{
return
dim_plus
(
lhs
,
rhs
);
}
/**
* Multiply two dimensions together
*/
template
<
int
i
>
HOSTDEVICE
Dim
<
i
>
dim_mult
(
const
Dim
<
i
>&
a
,
const
Dim
<
i
>&
b
)
{
template
<
int
i
>
HOSTDEVICE
Dim
<
i
>
dim_mult
(
const
Dim
<
i
>
&
a
,
const
Dim
<
i
>
&
b
)
{
return
Dim
<
i
>
(
a
.
head
*
b
.
head
,
dim_mult
(
a
.
tail
,
b
.
tail
));
}
// Base case
template
<
>
HOSTDEVICE
inline
Dim
<
0
>
dim_mult
(
const
Dim
<
0
>
&
a
,
const
Dim
<
0
>&
b
)
{
HOSTDEVICE
inline
Dim
<
0
>
dim_mult
(
const
Dim
<
0
>
&
a
,
const
Dim
<
0
>
&
b
)
{
return
Dim
<
0
>
();
}
template
<
int
i
>
HOSTDEVICE
Dim
<
i
>
operator
*
(
const
Dim
<
i
>
&
lhs
,
const
Dim
<
i
>&
rhs
)
{
HOSTDEVICE
Dim
<
i
>
operator
*
(
const
Dim
<
i
>
&
lhs
,
const
Dim
<
i
>
&
rhs
)
{
return
dim_mult
(
lhs
,
rhs
);
}
...
...
@@ -356,7 +333,7 @@ HOSTDEVICE Dim<i> operator*(const Dim<i>& lhs, const Dim<i>& rhs) {
*/
template
<
int
i
>
HOSTDEVICE
Dim
<
i
>
normalize_strides
(
const
Dim
<
i
>
&
size
,
const
Dim
<
i
>&
stride
)
{
HOSTDEVICE
Dim
<
i
>
normalize_strides
(
const
Dim
<
i
>
&
size
,
const
Dim
<
i
>
&
stride
)
{
int
norm_stride
=
size
.
head
==
1
?
0
:
stride
.
head
;
return
Dim
<
i
>
(
norm_stride
,
normalize_strides
(
size
.
tail
,
stride
.
tail
));
}
...
...
@@ -364,8 +341,8 @@ HOSTDEVICE Dim<i> normalize_strides(const Dim<i>& size, const Dim<i>& stride) {
///\cond HIDDEN
template
<
>
HOSTDEVICE
inline
Dim
<
0
>
normalize_strides
(
const
Dim
<
0
>
&
size
,
const
Dim
<
0
>
&
stride
)
{
HOSTDEVICE
inline
Dim
<
0
>
normalize_strides
(
const
Dim
<
0
>
&
size
,
const
Dim
<
0
>
&
stride
)
{
return
Dim
<
0
>
();
}
...
...
@@ -386,8 +363,8 @@ HOSTDEVICE Dim<sizeof...(Args)> make_dim(Args... idxes) {
// Allows us to output a Dim
// XXX For some reason, overloading fails to resolve this correctly
template
<
int
i
>
typename
std
::
enable_if
<
(
i
>
1
),
std
::
ostream
&>::
type
operator
<<
(
std
::
ostream
&
os
,
const
Dim
<
i
>&
d
)
{
typename
std
::
enable_if
<
(
i
>
1
),
std
::
ostream
&>::
type
operator
<<
(
std
::
ostream
&
os
,
const
Dim
<
i
>
&
d
)
{
os
<<
d
.
head
<<
", "
<<
d
.
tail
;
return
os
;
}
...
...
@@ -395,18 +372,17 @@ typename std::enable_if<(i > 1), std::ostream&>::type operator<<(
// Base case that allows us to output a Dim
// XXX I wish this could be an overload instead of a template
template
<
int
i
>
typename
std
::
enable_if
<
(
i
==
1
),
std
::
ostream
&>::
type
operator
<<
(
std
::
ostream
&
os
,
const
Dim
<
i
>&
d
)
{
typename
std
::
enable_if
<
(
i
==
1
),
std
::
ostream
&>::
type
operator
<<
(
std
::
ostream
&
os
,
const
Dim
<
i
>
&
d
)
{
os
<<
d
.
head
;
return
os
;
}
inline
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
Dim
<
0
>&
d
)
{
inline
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
Dim
<
0
>
&
d
)
{
return
os
;
}
template
<
int
i
>
HOST
std
::
string
Dim
<
i
>::
to_string
()
const
{
template
<
int
i
>
HOST
std
::
string
Dim
<
i
>::
to_string
()
const
{
std
::
stringstream
stream
;
stream
<<
*
this
;
...
...
@@ -428,5 +404,5 @@ HOSTDEVICE Dim<D> linear_to_dimension(int linear_index, Dim<D> extents) {
return
result
;
}
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/framework/executor.cpp
浏览文件 @
d2f8befa
...
...
@@ -102,5 +102,5 @@ void Executor<Dtype>::predict(const Tensor &t, int block_id) {
template
class
Executor
<
CPU
>;
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/framework/executor.h
浏览文件 @
d2f8befa
...
...
@@ -34,13 +34,12 @@ SOFTWARE.
namespace
paddle_mobile
{
namespace
framework
{
template
<
typename
Dtype
>
class
Executor
{
public:
template
<
typename
Dtype
>
class
Executor
{
public:
Executor
(
const
Program
<
Dtype
>
p
);
std
::
shared_ptr
<
Tensor
>
predict
(
Tensor
&
t
);
private:
private:
const
framework
::
Program
<
Dtype
>
program_
;
std
::
shared_ptr
<
ProgramDesc
>
to_predict_program_
;
void
predict
(
const
Tensor
&
t
,
int
block_id
);
...
...
@@ -50,5 +49,5 @@ class Executor {
bool
use_optimize_
=
false
;
};
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/framework/framework.pb.cpp
浏览文件 @
d2f8befa
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
src/framework/framework.pb.h
浏览文件 @
d2f8befa
...
...
@@ -21,14 +21,14 @@
#include <google/protobuf/arena.h>
#include <google/protobuf/arenastring.h>
#include <google/protobuf/extension_set.h>
// IWYU pragma: export
#include <google/protobuf/extension_set.h> // IWYU pragma: export
#include <google/protobuf/generated_enum_util.h>
#include <google/protobuf/generated_message_table_driven.h>
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/message_lite.h>
#include <google/protobuf/metadata_lite.h>
#include <google/protobuf/repeated_field.h>
// IWYU pragma: export
#include <google/protobuf/repeated_field.h> // IWYU pragma: export
// @@protoc_insertion_point(includes)
namespace
paddle_mobile
{
namespace
framework
{
...
...
@@ -86,9 +86,9 @@ extern VarType_TensorDescDefaultTypeInternal
class
VarType_Tuple
;
class
VarType_TupleDefaultTypeInternal
;
extern
VarType_TupleDefaultTypeInternal
_VarType_Tuple_default_instance_
;
}
// namespace proto
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace proto
}
// namespace framework
}
// namespace paddle_mobile
namespace
paddle_mobile
{
namespace
framework
{
...
...
@@ -108,7 +108,7 @@ struct TableStruct {
};
void
AddDescriptors
();
void
InitDefaults
();
}
// namespace protobuf_framework_2eproto
}
// namespace protobuf_framework_2eproto
enum
VarType_Type
{
VarType_Type_BOOL
=
0
,
...
...
@@ -160,79 +160,80 @@ class OpDesc_Attr
MessageLite
/* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.OpDesc.Attr)
*/
{
public:
public:
OpDesc_Attr
();
virtual
~
OpDesc_Attr
();
OpDesc_Attr
(
const
OpDesc_Attr
&
from
);
OpDesc_Attr
(
const
OpDesc_Attr
&
from
);
inline
OpDesc_Attr
&
operator
=
(
const
OpDesc_Attr
&
from
)
{
inline
OpDesc_Attr
&
operator
=
(
const
OpDesc_Attr
&
from
)
{
CopyFrom
(
from
);
return
*
this
;
}
#if LANG_CXX11
OpDesc_Attr
(
OpDesc_Attr
&&
from
)
noexcept
:
OpDesc_Attr
()
{
OpDesc_Attr
(
OpDesc_Attr
&&
from
)
noexcept
:
OpDesc_Attr
()
{
*
this
=
::
std
::
move
(
from
);
}
inline
OpDesc_Attr
&
operator
=
(
OpDesc_Attr
&&
from
)
noexcept
{
inline
OpDesc_Attr
&
operator
=
(
OpDesc_Attr
&&
from
)
noexcept
{
if
(
GetArenaNoVirtual
()
==
from
.
GetArenaNoVirtual
())
{
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
}
else
{
CopyFrom
(
from
);
}
return
*
this
;
}
#endif
inline
const
::
std
::
string
&
unknown_fields
()
const
{
inline
const
::
std
::
string
&
unknown_fields
()
const
{
return
_internal_metadata_
.
unknown_fields
();
}
inline
::
std
::
string
*
mutable_unknown_fields
()
{
inline
::
std
::
string
*
mutable_unknown_fields
()
{
return
_internal_metadata_
.
mutable_unknown_fields
();
}
static
const
OpDesc_Attr
&
default_instance
();
static
const
OpDesc_Attr
&
default_instance
();
static
inline
const
OpDesc_Attr
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
OpDesc_Attr
*>
(
static
inline
const
OpDesc_Attr
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
OpDesc_Attr
*>
(
&
_OpDesc_Attr_default_instance_
);
}
static
PROTOBUF_CONSTEXPR
int
const
kIndexInFileMessages
=
0
;
void
Swap
(
OpDesc_Attr
*
other
);
friend
void
swap
(
OpDesc_Attr
&
a
,
OpDesc_Attr
&
b
)
{
a
.
Swap
(
&
b
);
}
void
Swap
(
OpDesc_Attr
*
other
);
friend
void
swap
(
OpDesc_Attr
&
a
,
OpDesc_Attr
&
b
)
{
a
.
Swap
(
&
b
);
}
// implements Message ----------------------------------------------
inline
OpDesc_Attr
*
New
()
const
PROTOBUF_FINAL
{
return
New
(
NULL
);
}
inline
OpDesc_Attr
*
New
()
const
PROTOBUF_FINAL
{
return
New
(
NULL
);
}
OpDesc_Attr
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
OpDesc_Attr
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
PROTOBUF_FINAL
;
void
CopyFrom
(
const
OpDesc_Attr
&
from
);
void
MergeFrom
(
const
OpDesc_Attr
&
from
);
void
CopyFrom
(
const
OpDesc_Attr
&
from
);
void
MergeFrom
(
const
OpDesc_Attr
&
from
);
void
Clear
()
PROTOBUF_FINAL
;
bool
IsInitialized
()
const
PROTOBUF_FINAL
;
size_t
ByteSizeLong
()
const
PROTOBUF_FINAL
;
bool
MergePartialFromCodedStream
(
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
void
SerializeWithCachedSizes
(
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
void
DiscardUnknownFields
();
int
GetCachedSize
()
const
PROTOBUF_FINAL
{
return
_cached_size_
;
}
private:
private:
void
SharedCtor
();
void
SharedDtor
();
void
SetCachedSize
(
int
size
)
const
;
void
InternalSwap
(
OpDesc_Attr
*
other
);
void
InternalSwap
(
OpDesc_Attr
*
other
);
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
public:
public:
::
std
::
string
GetTypeName
()
const
PROTOBUF_FINAL
;
// nested types ----------------------------------------------------
...
...
@@ -246,9 +247,9 @@ class OpDesc_Attr
::
google
::
protobuf
::
int32
ints
(
int
index
)
const
;
void
set_ints
(
int
index
,
::
google
::
protobuf
::
int32
value
);
void
add_ints
(
::
google
::
protobuf
::
int32
value
);
const
::
google
::
protobuf
::
RepeatedField
<::
google
::
protobuf
::
int32
>
&
ints
()
const
;
::
google
::
protobuf
::
RepeatedField
<::
google
::
protobuf
::
int32
>
*
mutable_ints
();
const
::
google
::
protobuf
::
RepeatedField
<::
google
::
protobuf
::
int32
>
&
ints
()
const
;
::
google
::
protobuf
::
RepeatedField
<::
google
::
protobuf
::
int32
>
*
mutable_ints
();
// repeated float floats = 7;
int
floats_size
()
const
;
...
...
@@ -257,30 +258,30 @@ class OpDesc_Attr
float
floats
(
int
index
)
const
;
void
set_floats
(
int
index
,
float
value
);
void
add_floats
(
float
value
);
const
::
google
::
protobuf
::
RepeatedField
<
float
>
&
floats
()
const
;
::
google
::
protobuf
::
RepeatedField
<
float
>
*
mutable_floats
();
const
::
google
::
protobuf
::
RepeatedField
<
float
>
&
floats
()
const
;
::
google
::
protobuf
::
RepeatedField
<
float
>
*
mutable_floats
();
// repeated string strings = 8;
int
strings_size
()
const
;
void
clear_strings
();
static
const
int
kStringsFieldNumber
=
8
;
const
::
std
::
string
&
strings
(
int
index
)
const
;
::
std
::
string
*
mutable_strings
(
int
index
);
void
set_strings
(
int
index
,
const
::
std
::
string
&
value
);
const
::
std
::
string
&
strings
(
int
index
)
const
;
::
std
::
string
*
mutable_strings
(
int
index
);
void
set_strings
(
int
index
,
const
::
std
::
string
&
value
);
#if LANG_CXX11
void
set_strings
(
int
index
,
::
std
::
string
&&
value
);
void
set_strings
(
int
index
,
::
std
::
string
&&
value
);
#endif
void
set_strings
(
int
index
,
const
char
*
value
);
void
set_strings
(
int
index
,
const
char
*
value
,
size_t
size
);
::
std
::
string
*
add_strings
();
void
add_strings
(
const
::
std
::
string
&
value
);
void
set_strings
(
int
index
,
const
char
*
value
);
void
set_strings
(
int
index
,
const
char
*
value
,
size_t
size
);
::
std
::
string
*
add_strings
();
void
add_strings
(
const
::
std
::
string
&
value
);
#if LANG_CXX11
void
add_strings
(
::
std
::
string
&&
value
);
void
add_strings
(
::
std
::
string
&&
value
);
#endif
void
add_strings
(
const
char
*
value
);
void
add_strings
(
const
char
*
value
,
size_t
size
);
const
::
google
::
protobuf
::
RepeatedPtrField
<::
std
::
string
>
&
strings
()
const
;
::
google
::
protobuf
::
RepeatedPtrField
<::
std
::
string
>
*
mutable_strings
();
void
add_strings
(
const
char
*
value
);
void
add_strings
(
const
char
*
value
,
size_t
size
);
const
::
google
::
protobuf
::
RepeatedPtrField
<::
std
::
string
>
&
strings
()
const
;
::
google
::
protobuf
::
RepeatedPtrField
<::
std
::
string
>
*
mutable_strings
();
// repeated bool bools = 11;
int
bools_size
()
const
;
...
...
@@ -289,38 +290,38 @@ class OpDesc_Attr
bool
bools
(
int
index
)
const
;
void
set_bools
(
int
index
,
bool
value
);
void
add_bools
(
bool
value
);
const
::
google
::
protobuf
::
RepeatedField
<
bool
>
&
bools
()
const
;
::
google
::
protobuf
::
RepeatedField
<
bool
>
*
mutable_bools
();
const
::
google
::
protobuf
::
RepeatedField
<
bool
>
&
bools
()
const
;
::
google
::
protobuf
::
RepeatedField
<
bool
>
*
mutable_bools
();
// required string name = 1;
bool
has_name
()
const
;
void
clear_name
();
static
const
int
kNameFieldNumber
=
1
;
const
::
std
::
string
&
name
()
const
;
void
set_name
(
const
::
std
::
string
&
value
);
const
::
std
::
string
&
name
()
const
;
void
set_name
(
const
::
std
::
string
&
value
);
#if LANG_CXX11
void
set_name
(
::
std
::
string
&&
value
);
void
set_name
(
::
std
::
string
&&
value
);
#endif
void
set_name
(
const
char
*
value
);
void
set_name
(
const
char
*
value
,
size_t
size
);
::
std
::
string
*
mutable_name
();
::
std
::
string
*
release_name
();
void
set_allocated_name
(
::
std
::
string
*
name
);
void
set_name
(
const
char
*
value
);
void
set_name
(
const
char
*
value
,
size_t
size
);
::
std
::
string
*
mutable_name
();
::
std
::
string
*
release_name
();
void
set_allocated_name
(
::
std
::
string
*
name
);
// optional string s = 5;
bool
has_s
()
const
;
void
clear_s
();
static
const
int
kSFieldNumber
=
5
;
const
::
std
::
string
&
s
()
const
;
void
set_s
(
const
::
std
::
string
&
value
);
const
::
std
::
string
&
s
()
const
;
void
set_s
(
const
::
std
::
string
&
value
);
#if LANG_CXX11
void
set_s
(
::
std
::
string
&&
value
);
void
set_s
(
::
std
::
string
&&
value
);
#endif
void
set_s
(
const
char
*
value
);
void
set_s
(
const
char
*
value
,
size_t
size
);
::
std
::
string
*
mutable_s
();
::
std
::
string
*
release_s
();
void
set_allocated_s
(
::
std
::
string
*
s
);
void
set_s
(
const
char
*
value
);
void
set_s
(
const
char
*
value
,
size_t
size
);
::
std
::
string
*
mutable_s
();
::
std
::
string
*
release_s
();
void
set_allocated_s
(
::
std
::
string
*
s
);
// required .paddle_mobile.framework.proto.AttrType type = 2;
bool
has_type
()
const
;
...
...
@@ -365,7 +366,7 @@ class OpDesc_Attr
void
set_block_idx
(
::
google
::
protobuf
::
int32
value
);
// @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.OpDesc.Attr)
private:
private:
void
set_has_name
();
void
clear_has_name
();
void
set_has_type
();
...
...
@@ -411,78 +412,79 @@ class OpDesc_Var
MessageLite
/* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.OpDesc.Var)
*/
{
public:
public:
OpDesc_Var
();
virtual
~
OpDesc_Var
();
OpDesc_Var
(
const
OpDesc_Var
&
from
);
OpDesc_Var
(
const
OpDesc_Var
&
from
);
inline
OpDesc_Var
&
operator
=
(
const
OpDesc_Var
&
from
)
{
inline
OpDesc_Var
&
operator
=
(
const
OpDesc_Var
&
from
)
{
CopyFrom
(
from
);
return
*
this
;
}
#if LANG_CXX11
OpDesc_Var
(
OpDesc_Var
&&
from
)
noexcept
:
OpDesc_Var
()
{
OpDesc_Var
(
OpDesc_Var
&&
from
)
noexcept
:
OpDesc_Var
()
{
*
this
=
::
std
::
move
(
from
);
}
inline
OpDesc_Var
&
operator
=
(
OpDesc_Var
&&
from
)
noexcept
{
inline
OpDesc_Var
&
operator
=
(
OpDesc_Var
&&
from
)
noexcept
{
if
(
GetArenaNoVirtual
()
==
from
.
GetArenaNoVirtual
())
{
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
}
else
{
CopyFrom
(
from
);
}
return
*
this
;
}
#endif
inline
const
::
std
::
string
&
unknown_fields
()
const
{
inline
const
::
std
::
string
&
unknown_fields
()
const
{
return
_internal_metadata_
.
unknown_fields
();
}
inline
::
std
::
string
*
mutable_unknown_fields
()
{
inline
::
std
::
string
*
mutable_unknown_fields
()
{
return
_internal_metadata_
.
mutable_unknown_fields
();
}
static
const
OpDesc_Var
&
default_instance
();
static
const
OpDesc_Var
&
default_instance
();
static
inline
const
OpDesc_Var
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
OpDesc_Var
*>
(
&
_OpDesc_Var_default_instance_
);
static
inline
const
OpDesc_Var
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
OpDesc_Var
*>
(
&
_OpDesc_Var_default_instance_
);
}
static
PROTOBUF_CONSTEXPR
int
const
kIndexInFileMessages
=
1
;
void
Swap
(
OpDesc_Var
*
other
);
friend
void
swap
(
OpDesc_Var
&
a
,
OpDesc_Var
&
b
)
{
a
.
Swap
(
&
b
);
}
void
Swap
(
OpDesc_Var
*
other
);
friend
void
swap
(
OpDesc_Var
&
a
,
OpDesc_Var
&
b
)
{
a
.
Swap
(
&
b
);
}
// implements Message ----------------------------------------------
inline
OpDesc_Var
*
New
()
const
PROTOBUF_FINAL
{
return
New
(
NULL
);
}
inline
OpDesc_Var
*
New
()
const
PROTOBUF_FINAL
{
return
New
(
NULL
);
}
OpDesc_Var
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
OpDesc_Var
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
PROTOBUF_FINAL
;
void
CopyFrom
(
const
OpDesc_Var
&
from
);
void
MergeFrom
(
const
OpDesc_Var
&
from
);
void
CopyFrom
(
const
OpDesc_Var
&
from
);
void
MergeFrom
(
const
OpDesc_Var
&
from
);
void
Clear
()
PROTOBUF_FINAL
;
bool
IsInitialized
()
const
PROTOBUF_FINAL
;
size_t
ByteSizeLong
()
const
PROTOBUF_FINAL
;
bool
MergePartialFromCodedStream
(
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
void
SerializeWithCachedSizes
(
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
void
DiscardUnknownFields
();
int
GetCachedSize
()
const
PROTOBUF_FINAL
{
return
_cached_size_
;
}
private:
private:
void
SharedCtor
();
void
SharedDtor
();
void
SetCachedSize
(
int
size
)
const
;
void
InternalSwap
(
OpDesc_Var
*
other
);
void
InternalSwap
(
OpDesc_Var
*
other
);
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
public:
public:
::
std
::
string
GetTypeName
()
const
PROTOBUF_FINAL
;
// nested types ----------------------------------------------------
...
...
@@ -493,41 +495,41 @@ class OpDesc_Var
int
arguments_size
()
const
;
void
clear_arguments
();
static
const
int
kArgumentsFieldNumber
=
2
;
const
::
std
::
string
&
arguments
(
int
index
)
const
;
::
std
::
string
*
mutable_arguments
(
int
index
);
void
set_arguments
(
int
index
,
const
::
std
::
string
&
value
);
const
::
std
::
string
&
arguments
(
int
index
)
const
;
::
std
::
string
*
mutable_arguments
(
int
index
);
void
set_arguments
(
int
index
,
const
::
std
::
string
&
value
);
#if LANG_CXX11
void
set_arguments
(
int
index
,
::
std
::
string
&&
value
);
void
set_arguments
(
int
index
,
::
std
::
string
&&
value
);
#endif
void
set_arguments
(
int
index
,
const
char
*
value
);
void
set_arguments
(
int
index
,
const
char
*
value
,
size_t
size
);
::
std
::
string
*
add_arguments
();
void
add_arguments
(
const
::
std
::
string
&
value
);
void
set_arguments
(
int
index
,
const
char
*
value
);
void
set_arguments
(
int
index
,
const
char
*
value
,
size_t
size
);
::
std
::
string
*
add_arguments
();
void
add_arguments
(
const
::
std
::
string
&
value
);
#if LANG_CXX11
void
add_arguments
(
::
std
::
string
&&
value
);
void
add_arguments
(
::
std
::
string
&&
value
);
#endif
void
add_arguments
(
const
char
*
value
);
void
add_arguments
(
const
char
*
value
,
size_t
size
);
const
::
google
::
protobuf
::
RepeatedPtrField
<::
std
::
string
>
&
arguments
()
const
;
::
google
::
protobuf
::
RepeatedPtrField
<::
std
::
string
>
*
mutable_arguments
();
void
add_arguments
(
const
char
*
value
);
void
add_arguments
(
const
char
*
value
,
size_t
size
);
const
::
google
::
protobuf
::
RepeatedPtrField
<::
std
::
string
>
&
arguments
()
const
;
::
google
::
protobuf
::
RepeatedPtrField
<::
std
::
string
>
*
mutable_arguments
();
// required string parameter = 1;
bool
has_parameter
()
const
;
void
clear_parameter
();
static
const
int
kParameterFieldNumber
=
1
;
const
::
std
::
string
&
parameter
()
const
;
void
set_parameter
(
const
::
std
::
string
&
value
);
const
::
std
::
string
&
parameter
()
const
;
void
set_parameter
(
const
::
std
::
string
&
value
);
#if LANG_CXX11
void
set_parameter
(
::
std
::
string
&&
value
);
void
set_parameter
(
::
std
::
string
&&
value
);
#endif
void
set_parameter
(
const
char
*
value
);
void
set_parameter
(
const
char
*
value
,
size_t
size
);
::
std
::
string
*
mutable_parameter
();
::
std
::
string
*
release_parameter
();
void
set_allocated_parameter
(
::
std
::
string
*
parameter
);
void
set_parameter
(
const
char
*
value
);
void
set_parameter
(
const
char
*
value
,
size_t
size
);
::
std
::
string
*
mutable_parameter
();
::
std
::
string
*
release_parameter
();
void
set_allocated_parameter
(
::
std
::
string
*
parameter
);
// @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.OpDesc.Var)
private:
private:
void
set_has_parameter
();
void
clear_has_parameter
();
...
...
@@ -546,76 +548,77 @@ class OpDesc
MessageLite
/* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.OpDesc)
*/
{
public:
public:
OpDesc
();
virtual
~
OpDesc
();
OpDesc
(
const
OpDesc
&
from
);
OpDesc
(
const
OpDesc
&
from
);
inline
OpDesc
&
operator
=
(
const
OpDesc
&
from
)
{
inline
OpDesc
&
operator
=
(
const
OpDesc
&
from
)
{
CopyFrom
(
from
);
return
*
this
;
}
#if LANG_CXX11
OpDesc
(
OpDesc
&&
from
)
noexcept
:
OpDesc
()
{
*
this
=
::
std
::
move
(
from
);
}
OpDesc
(
OpDesc
&&
from
)
noexcept
:
OpDesc
()
{
*
this
=
::
std
::
move
(
from
);
}
inline
OpDesc
&
operator
=
(
OpDesc
&&
from
)
noexcept
{
inline
OpDesc
&
operator
=
(
OpDesc
&&
from
)
noexcept
{
if
(
GetArenaNoVirtual
()
==
from
.
GetArenaNoVirtual
())
{
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
}
else
{
CopyFrom
(
from
);
}
return
*
this
;
}
#endif
inline
const
::
std
::
string
&
unknown_fields
()
const
{
inline
const
::
std
::
string
&
unknown_fields
()
const
{
return
_internal_metadata_
.
unknown_fields
();
}
inline
::
std
::
string
*
mutable_unknown_fields
()
{
inline
::
std
::
string
*
mutable_unknown_fields
()
{
return
_internal_metadata_
.
mutable_unknown_fields
();
}
static
const
OpDesc
&
default_instance
();
static
const
OpDesc
&
default_instance
();
static
inline
const
OpDesc
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
OpDesc
*>
(
&
_OpDesc_default_instance_
);
static
inline
const
OpDesc
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
OpDesc
*>
(
&
_OpDesc_default_instance_
);
}
static
PROTOBUF_CONSTEXPR
int
const
kIndexInFileMessages
=
2
;
void
Swap
(
OpDesc
*
other
);
friend
void
swap
(
OpDesc
&
a
,
OpDesc
&
b
)
{
a
.
Swap
(
&
b
);
}
void
Swap
(
OpDesc
*
other
);
friend
void
swap
(
OpDesc
&
a
,
OpDesc
&
b
)
{
a
.
Swap
(
&
b
);
}
// implements Message ----------------------------------------------
inline
OpDesc
*
New
()
const
PROTOBUF_FINAL
{
return
New
(
NULL
);
}
inline
OpDesc
*
New
()
const
PROTOBUF_FINAL
{
return
New
(
NULL
);
}
OpDesc
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
OpDesc
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
PROTOBUF_FINAL
;
void
CopyFrom
(
const
OpDesc
&
from
);
void
MergeFrom
(
const
OpDesc
&
from
);
void
CopyFrom
(
const
OpDesc
&
from
);
void
MergeFrom
(
const
OpDesc
&
from
);
void
Clear
()
PROTOBUF_FINAL
;
bool
IsInitialized
()
const
PROTOBUF_FINAL
;
size_t
ByteSizeLong
()
const
PROTOBUF_FINAL
;
bool
MergePartialFromCodedStream
(
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
void
SerializeWithCachedSizes
(
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
void
DiscardUnknownFields
();
int
GetCachedSize
()
const
PROTOBUF_FINAL
{
return
_cached_size_
;
}
private:
private:
void
SharedCtor
();
void
SharedDtor
();
void
SetCachedSize
(
int
size
)
const
;
void
InternalSwap
(
OpDesc
*
other
);
void
InternalSwap
(
OpDesc
*
other
);
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
public:
public:
::
std
::
string
GetTypeName
()
const
PROTOBUF_FINAL
;
// nested types ----------------------------------------------------
...
...
@@ -629,58 +632,58 @@ class OpDesc
int
inputs_size
()
const
;
void
clear_inputs
();
static
const
int
kInputsFieldNumber
=
1
;
const
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
&
inputs
(
int
index
)
const
;
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
*
mutable_inputs
(
int
index
);
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
*
add_inputs
();
const
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
&
inputs
(
int
index
)
const
;
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
*
mutable_inputs
(
int
index
);
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
*
add_inputs
();
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
>*
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
>
*
mutable_inputs
();
const
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
>&
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
>
&
inputs
()
const
;
// repeated .paddle_mobile.framework.proto.OpDesc.Var outputs = 2;
int
outputs_size
()
const
;
void
clear_outputs
();
static
const
int
kOutputsFieldNumber
=
2
;
const
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
&
outputs
(
int
index
)
const
;
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
*
mutable_outputs
(
int
index
);
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
*
add_outputs
();
const
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
&
outputs
(
int
index
)
const
;
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
*
mutable_outputs
(
int
index
);
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
*
add_outputs
();
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
>*
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
>
*
mutable_outputs
();
const
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
>&
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
>
&
outputs
()
const
;
// repeated .paddle_mobile.framework.proto.OpDesc.Attr attrs = 4;
int
attrs_size
()
const
;
void
clear_attrs
();
static
const
int
kAttrsFieldNumber
=
4
;
const
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Attr
&
attrs
(
int
index
)
const
;
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Attr
*
mutable_attrs
(
int
index
);
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Attr
*
add_attrs
();
const
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Attr
&
attrs
(
int
index
)
const
;
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Attr
*
mutable_attrs
(
int
index
);
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Attr
*
add_attrs
();
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Attr
>*
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Attr
>
*
mutable_attrs
();
const
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Attr
>&
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Attr
>
&
attrs
()
const
;
// required string type = 3;
bool
has_type
()
const
;
void
clear_type
();
static
const
int
kTypeFieldNumber
=
3
;
const
::
std
::
string
&
type
()
const
;
void
set_type
(
const
::
std
::
string
&
value
);
const
::
std
::
string
&
type
()
const
;
void
set_type
(
const
::
std
::
string
&
value
);
#if LANG_CXX11
void
set_type
(
::
std
::
string
&&
value
);
void
set_type
(
::
std
::
string
&&
value
);
#endif
void
set_type
(
const
char
*
value
);
void
set_type
(
const
char
*
value
,
size_t
size
);
::
std
::
string
*
mutable_type
();
::
std
::
string
*
release_type
();
void
set_allocated_type
(
::
std
::
string
*
type
);
void
set_type
(
const
char
*
value
);
void
set_type
(
const
char
*
value
,
size_t
size
);
::
std
::
string
*
mutable_type
();
::
std
::
string
*
release_type
();
void
set_allocated_type
(
::
std
::
string
*
type
);
// optional bool is_target = 5 [default = false];
bool
has_is_target
()
const
;
...
...
@@ -690,7 +693,7 @@ class OpDesc
void
set_is_target
(
bool
value
);
// @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.OpDesc)
private:
private:
void
set_has_type
();
void
clear_has_type
();
void
set_has_is_target
();
...
...
@@ -720,79 +723,80 @@ class OpProto_Var
MessageLite
/* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.OpProto.Var)
*/
{
public:
public:
OpProto_Var
();
virtual
~
OpProto_Var
();
OpProto_Var
(
const
OpProto_Var
&
from
);
OpProto_Var
(
const
OpProto_Var
&
from
);
inline
OpProto_Var
&
operator
=
(
const
OpProto_Var
&
from
)
{
inline
OpProto_Var
&
operator
=
(
const
OpProto_Var
&
from
)
{
CopyFrom
(
from
);
return
*
this
;
}
#if LANG_CXX11
OpProto_Var
(
OpProto_Var
&&
from
)
noexcept
:
OpProto_Var
()
{
OpProto_Var
(
OpProto_Var
&&
from
)
noexcept
:
OpProto_Var
()
{
*
this
=
::
std
::
move
(
from
);
}
inline
OpProto_Var
&
operator
=
(
OpProto_Var
&&
from
)
noexcept
{
inline
OpProto_Var
&
operator
=
(
OpProto_Var
&&
from
)
noexcept
{
if
(
GetArenaNoVirtual
()
==
from
.
GetArenaNoVirtual
())
{
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
}
else
{
CopyFrom
(
from
);
}
return
*
this
;
}
#endif
inline
const
::
std
::
string
&
unknown_fields
()
const
{
inline
const
::
std
::
string
&
unknown_fields
()
const
{
return
_internal_metadata_
.
unknown_fields
();
}
inline
::
std
::
string
*
mutable_unknown_fields
()
{
inline
::
std
::
string
*
mutable_unknown_fields
()
{
return
_internal_metadata_
.
mutable_unknown_fields
();
}
static
const
OpProto_Var
&
default_instance
();
static
const
OpProto_Var
&
default_instance
();
static
inline
const
OpProto_Var
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
OpProto_Var
*>
(
static
inline
const
OpProto_Var
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
OpProto_Var
*>
(
&
_OpProto_Var_default_instance_
);
}
static
PROTOBUF_CONSTEXPR
int
const
kIndexInFileMessages
=
3
;
void
Swap
(
OpProto_Var
*
other
);
friend
void
swap
(
OpProto_Var
&
a
,
OpProto_Var
&
b
)
{
a
.
Swap
(
&
b
);
}
void
Swap
(
OpProto_Var
*
other
);
friend
void
swap
(
OpProto_Var
&
a
,
OpProto_Var
&
b
)
{
a
.
Swap
(
&
b
);
}
// implements Message ----------------------------------------------
inline
OpProto_Var
*
New
()
const
PROTOBUF_FINAL
{
return
New
(
NULL
);
}
inline
OpProto_Var
*
New
()
const
PROTOBUF_FINAL
{
return
New
(
NULL
);
}
OpProto_Var
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
OpProto_Var
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
PROTOBUF_FINAL
;
void
CopyFrom
(
const
OpProto_Var
&
from
);
void
MergeFrom
(
const
OpProto_Var
&
from
);
void
CopyFrom
(
const
OpProto_Var
&
from
);
void
MergeFrom
(
const
OpProto_Var
&
from
);
void
Clear
()
PROTOBUF_FINAL
;
bool
IsInitialized
()
const
PROTOBUF_FINAL
;
size_t
ByteSizeLong
()
const
PROTOBUF_FINAL
;
bool
MergePartialFromCodedStream
(
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
void
SerializeWithCachedSizes
(
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
void
DiscardUnknownFields
();
int
GetCachedSize
()
const
PROTOBUF_FINAL
{
return
_cached_size_
;
}
private:
private:
void
SharedCtor
();
void
SharedDtor
();
void
SetCachedSize
(
int
size
)
const
;
void
InternalSwap
(
OpProto_Var
*
other
);
void
InternalSwap
(
OpProto_Var
*
other
);
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
public:
public:
::
std
::
string
GetTypeName
()
const
PROTOBUF_FINAL
;
// nested types ----------------------------------------------------
...
...
@@ -803,31 +807,31 @@ class OpProto_Var
bool
has_name
()
const
;
void
clear_name
();
static
const
int
kNameFieldNumber
=
1
;
const
::
std
::
string
&
name
()
const
;
void
set_name
(
const
::
std
::
string
&
value
);
const
::
std
::
string
&
name
()
const
;
void
set_name
(
const
::
std
::
string
&
value
);
#if LANG_CXX11
void
set_name
(
::
std
::
string
&&
value
);
void
set_name
(
::
std
::
string
&&
value
);
#endif
void
set_name
(
const
char
*
value
);
void
set_name
(
const
char
*
value
,
size_t
size
);
::
std
::
string
*
mutable_name
();
::
std
::
string
*
release_name
();
void
set_allocated_name
(
::
std
::
string
*
name
);
void
set_name
(
const
char
*
value
);
void
set_name
(
const
char
*
value
,
size_t
size
);
::
std
::
string
*
mutable_name
();
::
std
::
string
*
release_name
();
void
set_allocated_name
(
::
std
::
string
*
name
);
// required string comment = 2;
bool
has_comment
()
const
;
void
clear_comment
();
static
const
int
kCommentFieldNumber
=
2
;
const
::
std
::
string
&
comment
()
const
;
void
set_comment
(
const
::
std
::
string
&
value
);
const
::
std
::
string
&
comment
()
const
;
void
set_comment
(
const
::
std
::
string
&
value
);
#if LANG_CXX11
void
set_comment
(
::
std
::
string
&&
value
);
void
set_comment
(
::
std
::
string
&&
value
);
#endif
void
set_comment
(
const
char
*
value
);
void
set_comment
(
const
char
*
value
,
size_t
size
);
::
std
::
string
*
mutable_comment
();
::
std
::
string
*
release_comment
();
void
set_allocated_comment
(
::
std
::
string
*
comment
);
void
set_comment
(
const
char
*
value
);
void
set_comment
(
const
char
*
value
,
size_t
size
);
::
std
::
string
*
mutable_comment
();
::
std
::
string
*
release_comment
();
void
set_allocated_comment
(
::
std
::
string
*
comment
);
// optional bool duplicable = 3 [default = false];
bool
has_duplicable
()
const
;
...
...
@@ -851,7 +855,7 @@ class OpProto_Var
void
set_dispensable
(
bool
value
);
// @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.OpProto.Var)
private:
private:
void
set_has_name
();
void
clear_has_name
();
void
set_has_comment
();
...
...
@@ -884,79 +888,80 @@ class OpProto_Attr
MessageLite
/* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.OpProto.Attr)
*/
{
public:
public:
OpProto_Attr
();
virtual
~
OpProto_Attr
();
OpProto_Attr
(
const
OpProto_Attr
&
from
);
OpProto_Attr
(
const
OpProto_Attr
&
from
);
inline
OpProto_Attr
&
operator
=
(
const
OpProto_Attr
&
from
)
{
inline
OpProto_Attr
&
operator
=
(
const
OpProto_Attr
&
from
)
{
CopyFrom
(
from
);
return
*
this
;
}
#if LANG_CXX11
OpProto_Attr
(
OpProto_Attr
&&
from
)
noexcept
:
OpProto_Attr
()
{
OpProto_Attr
(
OpProto_Attr
&&
from
)
noexcept
:
OpProto_Attr
()
{
*
this
=
::
std
::
move
(
from
);
}
inline
OpProto_Attr
&
operator
=
(
OpProto_Attr
&&
from
)
noexcept
{
inline
OpProto_Attr
&
operator
=
(
OpProto_Attr
&&
from
)
noexcept
{
if
(
GetArenaNoVirtual
()
==
from
.
GetArenaNoVirtual
())
{
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
}
else
{
CopyFrom
(
from
);
}
return
*
this
;
}
#endif
inline
const
::
std
::
string
&
unknown_fields
()
const
{
inline
const
::
std
::
string
&
unknown_fields
()
const
{
return
_internal_metadata_
.
unknown_fields
();
}
inline
::
std
::
string
*
mutable_unknown_fields
()
{
inline
::
std
::
string
*
mutable_unknown_fields
()
{
return
_internal_metadata_
.
mutable_unknown_fields
();
}
static
const
OpProto_Attr
&
default_instance
();
static
const
OpProto_Attr
&
default_instance
();
static
inline
const
OpProto_Attr
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
OpProto_Attr
*>
(
static
inline
const
OpProto_Attr
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
OpProto_Attr
*>
(
&
_OpProto_Attr_default_instance_
);
}
static
PROTOBUF_CONSTEXPR
int
const
kIndexInFileMessages
=
4
;
void
Swap
(
OpProto_Attr
*
other
);
friend
void
swap
(
OpProto_Attr
&
a
,
OpProto_Attr
&
b
)
{
a
.
Swap
(
&
b
);
}
void
Swap
(
OpProto_Attr
*
other
);
friend
void
swap
(
OpProto_Attr
&
a
,
OpProto_Attr
&
b
)
{
a
.
Swap
(
&
b
);
}
// implements Message ----------------------------------------------
inline
OpProto_Attr
*
New
()
const
PROTOBUF_FINAL
{
return
New
(
NULL
);
}
inline
OpProto_Attr
*
New
()
const
PROTOBUF_FINAL
{
return
New
(
NULL
);
}
OpProto_Attr
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
OpProto_Attr
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
PROTOBUF_FINAL
;
void
CopyFrom
(
const
OpProto_Attr
&
from
);
void
MergeFrom
(
const
OpProto_Attr
&
from
);
void
CopyFrom
(
const
OpProto_Attr
&
from
);
void
MergeFrom
(
const
OpProto_Attr
&
from
);
void
Clear
()
PROTOBUF_FINAL
;
bool
IsInitialized
()
const
PROTOBUF_FINAL
;
size_t
ByteSizeLong
()
const
PROTOBUF_FINAL
;
bool
MergePartialFromCodedStream
(
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
void
SerializeWithCachedSizes
(
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
void
DiscardUnknownFields
();
int
GetCachedSize
()
const
PROTOBUF_FINAL
{
return
_cached_size_
;
}
private:
private:
void
SharedCtor
();
void
SharedDtor
();
void
SetCachedSize
(
int
size
)
const
;
void
InternalSwap
(
OpProto_Attr
*
other
);
void
InternalSwap
(
OpProto_Attr
*
other
);
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
public:
public:
::
std
::
string
GetTypeName
()
const
PROTOBUF_FINAL
;
// nested types ----------------------------------------------------
...
...
@@ -967,31 +972,31 @@ class OpProto_Attr
bool
has_name
()
const
;
void
clear_name
();
static
const
int
kNameFieldNumber
=
1
;
const
::
std
::
string
&
name
()
const
;
void
set_name
(
const
::
std
::
string
&
value
);
const
::
std
::
string
&
name
()
const
;
void
set_name
(
const
::
std
::
string
&
value
);
#if LANG_CXX11
void
set_name
(
::
std
::
string
&&
value
);
void
set_name
(
::
std
::
string
&&
value
);
#endif
void
set_name
(
const
char
*
value
);
void
set_name
(
const
char
*
value
,
size_t
size
);
::
std
::
string
*
mutable_name
();
::
std
::
string
*
release_name
();
void
set_allocated_name
(
::
std
::
string
*
name
);
void
set_name
(
const
char
*
value
);
void
set_name
(
const
char
*
value
,
size_t
size
);
::
std
::
string
*
mutable_name
();
::
std
::
string
*
release_name
();
void
set_allocated_name
(
::
std
::
string
*
name
);
// required string comment = 3;
bool
has_comment
()
const
;
void
clear_comment
();
static
const
int
kCommentFieldNumber
=
3
;
const
::
std
::
string
&
comment
()
const
;
void
set_comment
(
const
::
std
::
string
&
value
);
const
::
std
::
string
&
comment
()
const
;
void
set_comment
(
const
::
std
::
string
&
value
);
#if LANG_CXX11
void
set_comment
(
::
std
::
string
&&
value
);
void
set_comment
(
::
std
::
string
&&
value
);
#endif
void
set_comment
(
const
char
*
value
);
void
set_comment
(
const
char
*
value
,
size_t
size
);
::
std
::
string
*
mutable_comment
();
::
std
::
string
*
release_comment
();
void
set_allocated_comment
(
::
std
::
string
*
comment
);
void
set_comment
(
const
char
*
value
);
void
set_comment
(
const
char
*
value
,
size_t
size
);
::
std
::
string
*
mutable_comment
();
::
std
::
string
*
release_comment
();
void
set_allocated_comment
(
::
std
::
string
*
comment
);
// required .paddle_mobile.framework.proto.AttrType type = 2;
bool
has_type
()
const
;
...
...
@@ -1008,7 +1013,7 @@ class OpProto_Attr
void
set_generated
(
bool
value
);
// @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.OpProto.Attr)
private:
private:
void
set_has_name
();
void
clear_has_name
();
void
set_has_type
();
...
...
@@ -1038,76 +1043,77 @@ class OpProto
MessageLite
/* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.OpProto)
*/
{
public:
public:
OpProto
();
virtual
~
OpProto
();
OpProto
(
const
OpProto
&
from
);
OpProto
(
const
OpProto
&
from
);
inline
OpProto
&
operator
=
(
const
OpProto
&
from
)
{
inline
OpProto
&
operator
=
(
const
OpProto
&
from
)
{
CopyFrom
(
from
);
return
*
this
;
}
#if LANG_CXX11
OpProto
(
OpProto
&&
from
)
noexcept
:
OpProto
()
{
*
this
=
::
std
::
move
(
from
);
}
OpProto
(
OpProto
&&
from
)
noexcept
:
OpProto
()
{
*
this
=
::
std
::
move
(
from
);
}
inline
OpProto
&
operator
=
(
OpProto
&&
from
)
noexcept
{
inline
OpProto
&
operator
=
(
OpProto
&&
from
)
noexcept
{
if
(
GetArenaNoVirtual
()
==
from
.
GetArenaNoVirtual
())
{
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
}
else
{
CopyFrom
(
from
);
}
return
*
this
;
}
#endif
inline
const
::
std
::
string
&
unknown_fields
()
const
{
inline
const
::
std
::
string
&
unknown_fields
()
const
{
return
_internal_metadata_
.
unknown_fields
();
}
inline
::
std
::
string
*
mutable_unknown_fields
()
{
inline
::
std
::
string
*
mutable_unknown_fields
()
{
return
_internal_metadata_
.
mutable_unknown_fields
();
}
static
const
OpProto
&
default_instance
();
static
const
OpProto
&
default_instance
();
static
inline
const
OpProto
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
OpProto
*>
(
&
_OpProto_default_instance_
);
static
inline
const
OpProto
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
OpProto
*>
(
&
_OpProto_default_instance_
);
}
static
PROTOBUF_CONSTEXPR
int
const
kIndexInFileMessages
=
5
;
void
Swap
(
OpProto
*
other
);
friend
void
swap
(
OpProto
&
a
,
OpProto
&
b
)
{
a
.
Swap
(
&
b
);
}
void
Swap
(
OpProto
*
other
);
friend
void
swap
(
OpProto
&
a
,
OpProto
&
b
)
{
a
.
Swap
(
&
b
);
}
// implements Message ----------------------------------------------
inline
OpProto
*
New
()
const
PROTOBUF_FINAL
{
return
New
(
NULL
);
}
inline
OpProto
*
New
()
const
PROTOBUF_FINAL
{
return
New
(
NULL
);
}
OpProto
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
OpProto
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
PROTOBUF_FINAL
;
void
CopyFrom
(
const
OpProto
&
from
);
void
MergeFrom
(
const
OpProto
&
from
);
void
CopyFrom
(
const
OpProto
&
from
);
void
MergeFrom
(
const
OpProto
&
from
);
void
Clear
()
PROTOBUF_FINAL
;
bool
IsInitialized
()
const
PROTOBUF_FINAL
;
size_t
ByteSizeLong
()
const
PROTOBUF_FINAL
;
bool
MergePartialFromCodedStream
(
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
void
SerializeWithCachedSizes
(
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
void
DiscardUnknownFields
();
int
GetCachedSize
()
const
PROTOBUF_FINAL
{
return
_cached_size_
;
}
private:
private:
void
SharedCtor
();
void
SharedDtor
();
void
SetCachedSize
(
int
size
)
const
;
void
InternalSwap
(
OpProto
*
other
);
void
InternalSwap
(
OpProto
*
other
);
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
public:
public:
::
std
::
string
GetTypeName
()
const
PROTOBUF_FINAL
;
// nested types ----------------------------------------------------
...
...
@@ -1121,77 +1127,77 @@ class OpProto
int
inputs_size
()
const
;
void
clear_inputs
();
static
const
int
kInputsFieldNumber
=
2
;
const
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
&
inputs
(
int
index
)
const
;
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
*
mutable_inputs
(
int
index
);
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
*
add_inputs
();
const
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
&
inputs
(
int
index
)
const
;
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
*
mutable_inputs
(
int
index
);
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
*
add_inputs
();
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
>*
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
>
*
mutable_inputs
();
const
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
>&
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
>
&
inputs
()
const
;
// repeated .paddle_mobile.framework.proto.OpProto.Var outputs = 3;
int
outputs_size
()
const
;
void
clear_outputs
();
static
const
int
kOutputsFieldNumber
=
3
;
const
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
&
outputs
(
int
index
)
const
;
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
*
mutable_outputs
(
int
index
);
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
*
add_outputs
();
const
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
&
outputs
(
int
index
)
const
;
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
*
mutable_outputs
(
int
index
);
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
*
add_outputs
();
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
>*
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
>
*
mutable_outputs
();
const
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
>&
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
>
&
outputs
()
const
;
// repeated .paddle_mobile.framework.proto.OpProto.Attr attrs = 4;
int
attrs_size
()
const
;
void
clear_attrs
();
static
const
int
kAttrsFieldNumber
=
4
;
const
::
paddle_mobile
::
framework
::
proto
::
OpProto_Attr
&
attrs
(
int
index
)
const
;
::
paddle_mobile
::
framework
::
proto
::
OpProto_Attr
*
mutable_attrs
(
int
index
);
::
paddle_mobile
::
framework
::
proto
::
OpProto_Attr
*
add_attrs
();
const
::
paddle_mobile
::
framework
::
proto
::
OpProto_Attr
&
attrs
(
int
index
)
const
;
::
paddle_mobile
::
framework
::
proto
::
OpProto_Attr
*
mutable_attrs
(
int
index
);
::
paddle_mobile
::
framework
::
proto
::
OpProto_Attr
*
add_attrs
();
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
OpProto_Attr
>*
::
paddle_mobile
::
framework
::
proto
::
OpProto_Attr
>
*
mutable_attrs
();
const
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
OpProto_Attr
>&
::
paddle_mobile
::
framework
::
proto
::
OpProto_Attr
>
&
attrs
()
const
;
// required string type = 1;
bool
has_type
()
const
;
void
clear_type
();
static
const
int
kTypeFieldNumber
=
1
;
const
::
std
::
string
&
type
()
const
;
void
set_type
(
const
::
std
::
string
&
value
);
const
::
std
::
string
&
type
()
const
;
void
set_type
(
const
::
std
::
string
&
value
);
#if LANG_CXX11
void
set_type
(
::
std
::
string
&&
value
);
void
set_type
(
::
std
::
string
&&
value
);
#endif
void
set_type
(
const
char
*
value
);
void
set_type
(
const
char
*
value
,
size_t
size
);
::
std
::
string
*
mutable_type
();
::
std
::
string
*
release_type
();
void
set_allocated_type
(
::
std
::
string
*
type
);
void
set_type
(
const
char
*
value
);
void
set_type
(
const
char
*
value
,
size_t
size
);
::
std
::
string
*
mutable_type
();
::
std
::
string
*
release_type
();
void
set_allocated_type
(
::
std
::
string
*
type
);
// required string comment = 5;
bool
has_comment
()
const
;
void
clear_comment
();
static
const
int
kCommentFieldNumber
=
5
;
const
::
std
::
string
&
comment
()
const
;
void
set_comment
(
const
::
std
::
string
&
value
);
const
::
std
::
string
&
comment
()
const
;
void
set_comment
(
const
::
std
::
string
&
value
);
#if LANG_CXX11
void
set_comment
(
::
std
::
string
&&
value
);
void
set_comment
(
::
std
::
string
&&
value
);
#endif
void
set_comment
(
const
char
*
value
);
void
set_comment
(
const
char
*
value
,
size_t
size
);
::
std
::
string
*
mutable_comment
();
::
std
::
string
*
release_comment
();
void
set_allocated_comment
(
::
std
::
string
*
comment
);
void
set_comment
(
const
char
*
value
);
void
set_comment
(
const
char
*
value
,
size_t
size
);
::
std
::
string
*
mutable_comment
();
::
std
::
string
*
release_comment
();
void
set_allocated_comment
(
::
std
::
string
*
comment
);
// @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.OpProto)
private:
private:
void
set_has_type
();
void
clear_has_type
();
void
set_has_comment
();
...
...
@@ -1224,81 +1230,82 @@ class VarType_TensorDesc
MessageLite
/* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.VarType.TensorDesc)
*/
{
public:
public:
VarType_TensorDesc
();
virtual
~
VarType_TensorDesc
();
VarType_TensorDesc
(
const
VarType_TensorDesc
&
from
);
VarType_TensorDesc
(
const
VarType_TensorDesc
&
from
);
inline
VarType_TensorDesc
&
operator
=
(
const
VarType_TensorDesc
&
from
)
{
inline
VarType_TensorDesc
&
operator
=
(
const
VarType_TensorDesc
&
from
)
{
CopyFrom
(
from
);
return
*
this
;
}
#if LANG_CXX11
VarType_TensorDesc
(
VarType_TensorDesc
&&
from
)
noexcept
VarType_TensorDesc
(
VarType_TensorDesc
&&
from
)
noexcept
:
VarType_TensorDesc
()
{
*
this
=
::
std
::
move
(
from
);
}
inline
VarType_TensorDesc
&
operator
=
(
VarType_TensorDesc
&&
from
)
noexcept
{
inline
VarType_TensorDesc
&
operator
=
(
VarType_TensorDesc
&&
from
)
noexcept
{
if
(
GetArenaNoVirtual
()
==
from
.
GetArenaNoVirtual
())
{
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
}
else
{
CopyFrom
(
from
);
}
return
*
this
;
}
#endif
inline
const
::
std
::
string
&
unknown_fields
()
const
{
inline
const
::
std
::
string
&
unknown_fields
()
const
{
return
_internal_metadata_
.
unknown_fields
();
}
inline
::
std
::
string
*
mutable_unknown_fields
()
{
inline
::
std
::
string
*
mutable_unknown_fields
()
{
return
_internal_metadata_
.
mutable_unknown_fields
();
}
static
const
VarType_TensorDesc
&
default_instance
();
static
const
VarType_TensorDesc
&
default_instance
();
static
inline
const
VarType_TensorDesc
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
VarType_TensorDesc
*>
(
static
inline
const
VarType_TensorDesc
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
VarType_TensorDesc
*>
(
&
_VarType_TensorDesc_default_instance_
);
}
static
PROTOBUF_CONSTEXPR
int
const
kIndexInFileMessages
=
6
;
void
Swap
(
VarType_TensorDesc
*
other
);
friend
void
swap
(
VarType_TensorDesc
&
a
,
VarType_TensorDesc
&
b
)
{
a
.
Swap
(
&
b
);
}
void
Swap
(
VarType_TensorDesc
*
other
);
friend
void
swap
(
VarType_TensorDesc
&
a
,
VarType_TensorDesc
&
b
)
{
a
.
Swap
(
&
b
);
}
// implements Message ----------------------------------------------
inline
VarType_TensorDesc
*
New
()
const
PROTOBUF_FINAL
{
return
New
(
NULL
);
}
inline
VarType_TensorDesc
*
New
()
const
PROTOBUF_FINAL
{
return
New
(
NULL
);
}
VarType_TensorDesc
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
VarType_TensorDesc
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
PROTOBUF_FINAL
;
void
CopyFrom
(
const
VarType_TensorDesc
&
from
);
void
MergeFrom
(
const
VarType_TensorDesc
&
from
);
void
CopyFrom
(
const
VarType_TensorDesc
&
from
);
void
MergeFrom
(
const
VarType_TensorDesc
&
from
);
void
Clear
()
PROTOBUF_FINAL
;
bool
IsInitialized
()
const
PROTOBUF_FINAL
;
size_t
ByteSizeLong
()
const
PROTOBUF_FINAL
;
bool
MergePartialFromCodedStream
(
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
void
SerializeWithCachedSizes
(
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
void
DiscardUnknownFields
();
int
GetCachedSize
()
const
PROTOBUF_FINAL
{
return
_cached_size_
;
}
private:
private:
void
SharedCtor
();
void
SharedDtor
();
void
SetCachedSize
(
int
size
)
const
;
void
InternalSwap
(
VarType_TensorDesc
*
other
);
void
InternalSwap
(
VarType_TensorDesc
*
other
);
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
public:
public:
::
std
::
string
GetTypeName
()
const
PROTOBUF_FINAL
;
// nested types ----------------------------------------------------
...
...
@@ -1312,9 +1319,9 @@ class VarType_TensorDesc
::
google
::
protobuf
::
int64
dims
(
int
index
)
const
;
void
set_dims
(
int
index
,
::
google
::
protobuf
::
int64
value
);
void
add_dims
(
::
google
::
protobuf
::
int64
value
);
const
::
google
::
protobuf
::
RepeatedField
<::
google
::
protobuf
::
int64
>
&
dims
()
const
;
::
google
::
protobuf
::
RepeatedField
<::
google
::
protobuf
::
int64
>
*
mutable_dims
();
const
::
google
::
protobuf
::
RepeatedField
<::
google
::
protobuf
::
int64
>
&
dims
()
const
;
::
google
::
protobuf
::
RepeatedField
<::
google
::
protobuf
::
int64
>
*
mutable_dims
();
// required .paddle_mobile.framework.proto.VarType.Type data_type = 1;
bool
has_data_type
()
const
;
...
...
@@ -1324,7 +1331,7 @@ class VarType_TensorDesc
void
set_data_type
(
::
paddle_mobile
::
framework
::
proto
::
VarType_Type
value
);
// @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarType.TensorDesc)
private:
private:
void
set_has_data_type
();
void
clear_has_data_type
();
...
...
@@ -1343,84 +1350,85 @@ class VarType_LoDTensorDesc
MessageLite
/* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.VarType.LoDTensorDesc)
*/
{
public:
public:
VarType_LoDTensorDesc
();
virtual
~
VarType_LoDTensorDesc
();
VarType_LoDTensorDesc
(
const
VarType_LoDTensorDesc
&
from
);
VarType_LoDTensorDesc
(
const
VarType_LoDTensorDesc
&
from
);
inline
VarType_LoDTensorDesc
&
operator
=
(
const
VarType_LoDTensorDesc
&
from
)
{
inline
VarType_LoDTensorDesc
&
operator
=
(
const
VarType_LoDTensorDesc
&
from
)
{
CopyFrom
(
from
);
return
*
this
;
}
#if LANG_CXX11
VarType_LoDTensorDesc
(
VarType_LoDTensorDesc
&&
from
)
noexcept
VarType_LoDTensorDesc
(
VarType_LoDTensorDesc
&&
from
)
noexcept
:
VarType_LoDTensorDesc
()
{
*
this
=
::
std
::
move
(
from
);
}
inline
VarType_LoDTensorDesc
&
operator
=
(
VarType_LoDTensorDesc
&&
from
)
noexcept
{
inline
VarType_LoDTensorDesc
&
operator
=
(
VarType_LoDTensorDesc
&&
from
)
noexcept
{
if
(
GetArenaNoVirtual
()
==
from
.
GetArenaNoVirtual
())
{
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
}
else
{
CopyFrom
(
from
);
}
return
*
this
;
}
#endif
inline
const
::
std
::
string
&
unknown_fields
()
const
{
inline
const
::
std
::
string
&
unknown_fields
()
const
{
return
_internal_metadata_
.
unknown_fields
();
}
inline
::
std
::
string
*
mutable_unknown_fields
()
{
inline
::
std
::
string
*
mutable_unknown_fields
()
{
return
_internal_metadata_
.
mutable_unknown_fields
();
}
static
const
VarType_LoDTensorDesc
&
default_instance
();
static
const
VarType_LoDTensorDesc
&
default_instance
();
static
inline
const
VarType_LoDTensorDesc
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
VarType_LoDTensorDesc
*>
(
static
inline
const
VarType_LoDTensorDesc
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
VarType_LoDTensorDesc
*>
(
&
_VarType_LoDTensorDesc_default_instance_
);
}
static
PROTOBUF_CONSTEXPR
int
const
kIndexInFileMessages
=
7
;
void
Swap
(
VarType_LoDTensorDesc
*
other
);
friend
void
swap
(
VarType_LoDTensorDesc
&
a
,
VarType_LoDTensorDesc
&
b
)
{
void
Swap
(
VarType_LoDTensorDesc
*
other
);
friend
void
swap
(
VarType_LoDTensorDesc
&
a
,
VarType_LoDTensorDesc
&
b
)
{
a
.
Swap
(
&
b
);
}
// implements Message ----------------------------------------------
inline
VarType_LoDTensorDesc
*
New
()
const
PROTOBUF_FINAL
{
return
New
(
NULL
);
}
inline
VarType_LoDTensorDesc
*
New
()
const
PROTOBUF_FINAL
{
return
New
(
NULL
);
}
VarType_LoDTensorDesc
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
VarType_LoDTensorDesc
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
PROTOBUF_FINAL
;
void
CopyFrom
(
const
VarType_LoDTensorDesc
&
from
);
void
MergeFrom
(
const
VarType_LoDTensorDesc
&
from
);
void
CopyFrom
(
const
VarType_LoDTensorDesc
&
from
);
void
MergeFrom
(
const
VarType_LoDTensorDesc
&
from
);
void
Clear
()
PROTOBUF_FINAL
;
bool
IsInitialized
()
const
PROTOBUF_FINAL
;
size_t
ByteSizeLong
()
const
PROTOBUF_FINAL
;
bool
MergePartialFromCodedStream
(
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
void
SerializeWithCachedSizes
(
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
void
DiscardUnknownFields
();
int
GetCachedSize
()
const
PROTOBUF_FINAL
{
return
_cached_size_
;
}
private:
private:
void
SharedCtor
();
void
SharedDtor
();
void
SetCachedSize
(
int
size
)
const
;
void
InternalSwap
(
VarType_LoDTensorDesc
*
other
);
void
InternalSwap
(
VarType_LoDTensorDesc
*
other
);
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
public:
public:
::
std
::
string
GetTypeName
()
const
PROTOBUF_FINAL
;
// nested types ----------------------------------------------------
...
...
@@ -1431,11 +1439,11 @@ class VarType_LoDTensorDesc
bool
has_tensor
()
const
;
void
clear_tensor
();
static
const
int
kTensorFieldNumber
=
1
;
const
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
&
tensor
()
const
;
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
mutable_tensor
();
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
release_tensor
();
const
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
&
tensor
()
const
;
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
mutable_tensor
();
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
release_tensor
();
void
set_allocated_tensor
(
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
tensor
);
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
tensor
);
// optional int32 lod_level = 2 [default = 0];
bool
has_lod_level
()
const
;
...
...
@@ -1445,7 +1453,7 @@ class VarType_LoDTensorDesc
void
set_lod_level
(
::
google
::
protobuf
::
int32
value
);
// @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarType.LoDTensorDesc)
private:
private:
void
set_has_tensor
();
void
clear_has_tensor
();
void
set_has_lod_level
();
...
...
@@ -1455,7 +1463,7 @@ class VarType_LoDTensorDesc
_internal_metadata_
;
::
google
::
protobuf
::
internal
::
HasBits
<
1
>
_has_bits_
;
mutable
int
_cached_size_
;
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
tensor_
;
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
tensor_
;
::
google
::
protobuf
::
int32
lod_level_
;
friend
struct
protobuf_framework_2eproto
::
TableStruct
;
};
...
...
@@ -1466,88 +1474,89 @@ class VarType_LoDTensorArrayDesc
MessageLite
/* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc)
*/
{
public:
public:
VarType_LoDTensorArrayDesc
();
virtual
~
VarType_LoDTensorArrayDesc
();
VarType_LoDTensorArrayDesc
(
const
VarType_LoDTensorArrayDesc
&
from
);
VarType_LoDTensorArrayDesc
(
const
VarType_LoDTensorArrayDesc
&
from
);
inline
VarType_LoDTensorArrayDesc
&
operator
=
(
const
VarType_LoDTensorArrayDesc
&
from
)
{
inline
VarType_LoDTensorArrayDesc
&
operator
=
(
const
VarType_LoDTensorArrayDesc
&
from
)
{
CopyFrom
(
from
);
return
*
this
;
}
#if LANG_CXX11
VarType_LoDTensorArrayDesc
(
VarType_LoDTensorArrayDesc
&&
from
)
noexcept
VarType_LoDTensorArrayDesc
(
VarType_LoDTensorArrayDesc
&&
from
)
noexcept
:
VarType_LoDTensorArrayDesc
()
{
*
this
=
::
std
::
move
(
from
);
}
inline
VarType_LoDTensorArrayDesc
&
operator
=
(
VarType_LoDTensorArrayDesc
&&
from
)
noexcept
{
inline
VarType_LoDTensorArrayDesc
&
operator
=
(
VarType_LoDTensorArrayDesc
&&
from
)
noexcept
{
if
(
GetArenaNoVirtual
()
==
from
.
GetArenaNoVirtual
())
{
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
}
else
{
CopyFrom
(
from
);
}
return
*
this
;
}
#endif
inline
const
::
std
::
string
&
unknown_fields
()
const
{
inline
const
::
std
::
string
&
unknown_fields
()
const
{
return
_internal_metadata_
.
unknown_fields
();
}
inline
::
std
::
string
*
mutable_unknown_fields
()
{
inline
::
std
::
string
*
mutable_unknown_fields
()
{
return
_internal_metadata_
.
mutable_unknown_fields
();
}
static
const
VarType_LoDTensorArrayDesc
&
default_instance
();
static
const
VarType_LoDTensorArrayDesc
&
default_instance
();
static
inline
const
VarType_LoDTensorArrayDesc
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
VarType_LoDTensorArrayDesc
*>
(
static
inline
const
VarType_LoDTensorArrayDesc
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
VarType_LoDTensorArrayDesc
*>
(
&
_VarType_LoDTensorArrayDesc_default_instance_
);
}
static
PROTOBUF_CONSTEXPR
int
const
kIndexInFileMessages
=
8
;
void
Swap
(
VarType_LoDTensorArrayDesc
*
other
);
friend
void
swap
(
VarType_LoDTensorArrayDesc
&
a
,
VarType_LoDTensorArrayDesc
&
b
)
{
void
Swap
(
VarType_LoDTensorArrayDesc
*
other
);
friend
void
swap
(
VarType_LoDTensorArrayDesc
&
a
,
VarType_LoDTensorArrayDesc
&
b
)
{
a
.
Swap
(
&
b
);
}
// implements Message ----------------------------------------------
inline
VarType_LoDTensorArrayDesc
*
New
()
const
PROTOBUF_FINAL
{
inline
VarType_LoDTensorArrayDesc
*
New
()
const
PROTOBUF_FINAL
{
return
New
(
NULL
);
}
VarType_LoDTensorArrayDesc
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
VarType_LoDTensorArrayDesc
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
PROTOBUF_FINAL
;
void
CopyFrom
(
const
VarType_LoDTensorArrayDesc
&
from
);
void
MergeFrom
(
const
VarType_LoDTensorArrayDesc
&
from
);
void
CopyFrom
(
const
VarType_LoDTensorArrayDesc
&
from
);
void
MergeFrom
(
const
VarType_LoDTensorArrayDesc
&
from
);
void
Clear
()
PROTOBUF_FINAL
;
bool
IsInitialized
()
const
PROTOBUF_FINAL
;
size_t
ByteSizeLong
()
const
PROTOBUF_FINAL
;
bool
MergePartialFromCodedStream
(
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
void
SerializeWithCachedSizes
(
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
void
DiscardUnknownFields
();
int
GetCachedSize
()
const
PROTOBUF_FINAL
{
return
_cached_size_
;
}
private:
private:
void
SharedCtor
();
void
SharedDtor
();
void
SetCachedSize
(
int
size
)
const
;
void
InternalSwap
(
VarType_LoDTensorArrayDesc
*
other
);
void
InternalSwap
(
VarType_LoDTensorArrayDesc
*
other
);
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
public:
public:
::
std
::
string
GetTypeName
()
const
PROTOBUF_FINAL
;
// nested types ----------------------------------------------------
...
...
@@ -1558,11 +1567,11 @@ class VarType_LoDTensorArrayDesc
bool
has_tensor
()
const
;
void
clear_tensor
();
static
const
int
kTensorFieldNumber
=
1
;
const
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
&
tensor
()
const
;
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
mutable_tensor
();
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
release_tensor
();
const
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
&
tensor
()
const
;
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
mutable_tensor
();
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
release_tensor
();
void
set_allocated_tensor
(
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
tensor
);
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
tensor
);
// optional int32 lod_level = 2 [default = 0];
bool
has_lod_level
()
const
;
...
...
@@ -1572,7 +1581,7 @@ class VarType_LoDTensorArrayDesc
void
set_lod_level
(
::
google
::
protobuf
::
int32
value
);
// @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc)
private:
private:
void
set_has_tensor
();
void
clear_has_tensor
();
void
set_has_lod_level
();
...
...
@@ -1582,7 +1591,7 @@ class VarType_LoDTensorArrayDesc
_internal_metadata_
;
::
google
::
protobuf
::
internal
::
HasBits
<
1
>
_has_bits_
;
mutable
int
_cached_size_
;
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
tensor_
;
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
tensor_
;
::
google
::
protobuf
::
int32
lod_level_
;
friend
struct
protobuf_framework_2eproto
::
TableStruct
;
};
...
...
@@ -1593,81 +1602,82 @@ class VarType_ReaderDesc
MessageLite
/* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.VarType.ReaderDesc)
*/
{
public:
public:
VarType_ReaderDesc
();
virtual
~
VarType_ReaderDesc
();
VarType_ReaderDesc
(
const
VarType_ReaderDesc
&
from
);
VarType_ReaderDesc
(
const
VarType_ReaderDesc
&
from
);
inline
VarType_ReaderDesc
&
operator
=
(
const
VarType_ReaderDesc
&
from
)
{
inline
VarType_ReaderDesc
&
operator
=
(
const
VarType_ReaderDesc
&
from
)
{
CopyFrom
(
from
);
return
*
this
;
}
#if LANG_CXX11
VarType_ReaderDesc
(
VarType_ReaderDesc
&&
from
)
noexcept
VarType_ReaderDesc
(
VarType_ReaderDesc
&&
from
)
noexcept
:
VarType_ReaderDesc
()
{
*
this
=
::
std
::
move
(
from
);
}
inline
VarType_ReaderDesc
&
operator
=
(
VarType_ReaderDesc
&&
from
)
noexcept
{
inline
VarType_ReaderDesc
&
operator
=
(
VarType_ReaderDesc
&&
from
)
noexcept
{
if
(
GetArenaNoVirtual
()
==
from
.
GetArenaNoVirtual
())
{
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
}
else
{
CopyFrom
(
from
);
}
return
*
this
;
}
#endif
inline
const
::
std
::
string
&
unknown_fields
()
const
{
inline
const
::
std
::
string
&
unknown_fields
()
const
{
return
_internal_metadata_
.
unknown_fields
();
}
inline
::
std
::
string
*
mutable_unknown_fields
()
{
inline
::
std
::
string
*
mutable_unknown_fields
()
{
return
_internal_metadata_
.
mutable_unknown_fields
();
}
static
const
VarType_ReaderDesc
&
default_instance
();
static
const
VarType_ReaderDesc
&
default_instance
();
static
inline
const
VarType_ReaderDesc
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
VarType_ReaderDesc
*>
(
static
inline
const
VarType_ReaderDesc
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
VarType_ReaderDesc
*>
(
&
_VarType_ReaderDesc_default_instance_
);
}
static
PROTOBUF_CONSTEXPR
int
const
kIndexInFileMessages
=
9
;
void
Swap
(
VarType_ReaderDesc
*
other
);
friend
void
swap
(
VarType_ReaderDesc
&
a
,
VarType_ReaderDesc
&
b
)
{
a
.
Swap
(
&
b
);
}
void
Swap
(
VarType_ReaderDesc
*
other
);
friend
void
swap
(
VarType_ReaderDesc
&
a
,
VarType_ReaderDesc
&
b
)
{
a
.
Swap
(
&
b
);
}
// implements Message ----------------------------------------------
inline
VarType_ReaderDesc
*
New
()
const
PROTOBUF_FINAL
{
return
New
(
NULL
);
}
inline
VarType_ReaderDesc
*
New
()
const
PROTOBUF_FINAL
{
return
New
(
NULL
);
}
VarType_ReaderDesc
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
VarType_ReaderDesc
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
PROTOBUF_FINAL
;
void
CopyFrom
(
const
VarType_ReaderDesc
&
from
);
void
MergeFrom
(
const
VarType_ReaderDesc
&
from
);
void
CopyFrom
(
const
VarType_ReaderDesc
&
from
);
void
MergeFrom
(
const
VarType_ReaderDesc
&
from
);
void
Clear
()
PROTOBUF_FINAL
;
bool
IsInitialized
()
const
PROTOBUF_FINAL
;
size_t
ByteSizeLong
()
const
PROTOBUF_FINAL
;
bool
MergePartialFromCodedStream
(
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
void
SerializeWithCachedSizes
(
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
void
DiscardUnknownFields
();
int
GetCachedSize
()
const
PROTOBUF_FINAL
{
return
_cached_size_
;
}
private:
private:
void
SharedCtor
();
void
SharedDtor
();
void
SetCachedSize
(
int
size
)
const
;
void
InternalSwap
(
VarType_ReaderDesc
*
other
);
void
InternalSwap
(
VarType_ReaderDesc
*
other
);
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
public:
public:
::
std
::
string
GetTypeName
()
const
PROTOBUF_FINAL
;
// nested types ----------------------------------------------------
...
...
@@ -1679,20 +1689,20 @@ class VarType_ReaderDesc
int
lod_tensor_size
()
const
;
void
clear_lod_tensor
();
static
const
int
kLodTensorFieldNumber
=
1
;
const
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
&
lod_tensor
(
int
index
)
const
;
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
*
mutable_lod_tensor
(
int
index
);
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
*
add_lod_tensor
();
const
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
&
lod_tensor
(
int
index
)
const
;
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
*
mutable_lod_tensor
(
int
index
);
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
*
add_lod_tensor
();
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
>*
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
>
*
mutable_lod_tensor
();
const
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
>&
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
>
&
lod_tensor
()
const
;
// @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarType.ReaderDesc)
private:
private:
::
google
::
protobuf
::
internal
::
InternalMetadataWithArenaLite
_internal_metadata_
;
::
google
::
protobuf
::
internal
::
HasBits
<
1
>
_has_bits_
;
...
...
@@ -1709,83 +1719,84 @@ class VarType_ChannelDesc
MessageLite
/* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.VarType.ChannelDesc)
*/
{
public:
public:
VarType_ChannelDesc
();
virtual
~
VarType_ChannelDesc
();
VarType_ChannelDesc
(
const
VarType_ChannelDesc
&
from
);
VarType_ChannelDesc
(
const
VarType_ChannelDesc
&
from
);
inline
VarType_ChannelDesc
&
operator
=
(
const
VarType_ChannelDesc
&
from
)
{
inline
VarType_ChannelDesc
&
operator
=
(
const
VarType_ChannelDesc
&
from
)
{
CopyFrom
(
from
);
return
*
this
;
}
#if LANG_CXX11
VarType_ChannelDesc
(
VarType_ChannelDesc
&&
from
)
noexcept
VarType_ChannelDesc
(
VarType_ChannelDesc
&&
from
)
noexcept
:
VarType_ChannelDesc
()
{
*
this
=
::
std
::
move
(
from
);
}
inline
VarType_ChannelDesc
&
operator
=
(
VarType_ChannelDesc
&&
from
)
noexcept
{
inline
VarType_ChannelDesc
&
operator
=
(
VarType_ChannelDesc
&&
from
)
noexcept
{
if
(
GetArenaNoVirtual
()
==
from
.
GetArenaNoVirtual
())
{
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
}
else
{
CopyFrom
(
from
);
}
return
*
this
;
}
#endif
inline
const
::
std
::
string
&
unknown_fields
()
const
{
inline
const
::
std
::
string
&
unknown_fields
()
const
{
return
_internal_metadata_
.
unknown_fields
();
}
inline
::
std
::
string
*
mutable_unknown_fields
()
{
inline
::
std
::
string
*
mutable_unknown_fields
()
{
return
_internal_metadata_
.
mutable_unknown_fields
();
}
static
const
VarType_ChannelDesc
&
default_instance
();
static
const
VarType_ChannelDesc
&
default_instance
();
static
inline
const
VarType_ChannelDesc
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
VarType_ChannelDesc
*>
(
static
inline
const
VarType_ChannelDesc
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
VarType_ChannelDesc
*>
(
&
_VarType_ChannelDesc_default_instance_
);
}
static
PROTOBUF_CONSTEXPR
int
const
kIndexInFileMessages
=
10
;
void
Swap
(
VarType_ChannelDesc
*
other
);
friend
void
swap
(
VarType_ChannelDesc
&
a
,
VarType_ChannelDesc
&
b
)
{
void
Swap
(
VarType_ChannelDesc
*
other
);
friend
void
swap
(
VarType_ChannelDesc
&
a
,
VarType_ChannelDesc
&
b
)
{
a
.
Swap
(
&
b
);
}
// implements Message ----------------------------------------------
inline
VarType_ChannelDesc
*
New
()
const
PROTOBUF_FINAL
{
return
New
(
NULL
);
}
inline
VarType_ChannelDesc
*
New
()
const
PROTOBUF_FINAL
{
return
New
(
NULL
);
}
VarType_ChannelDesc
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
VarType_ChannelDesc
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
PROTOBUF_FINAL
;
void
CopyFrom
(
const
VarType_ChannelDesc
&
from
);
void
MergeFrom
(
const
VarType_ChannelDesc
&
from
);
void
CopyFrom
(
const
VarType_ChannelDesc
&
from
);
void
MergeFrom
(
const
VarType_ChannelDesc
&
from
);
void
Clear
()
PROTOBUF_FINAL
;
bool
IsInitialized
()
const
PROTOBUF_FINAL
;
size_t
ByteSizeLong
()
const
PROTOBUF_FINAL
;
bool
MergePartialFromCodedStream
(
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
void
SerializeWithCachedSizes
(
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
void
DiscardUnknownFields
();
int
GetCachedSize
()
const
PROTOBUF_FINAL
{
return
_cached_size_
;
}
private:
private:
void
SharedCtor
();
void
SharedDtor
();
void
SetCachedSize
(
int
size
)
const
;
void
InternalSwap
(
VarType_ChannelDesc
*
other
);
void
InternalSwap
(
VarType_ChannelDesc
*
other
);
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
public:
public:
::
std
::
string
GetTypeName
()
const
PROTOBUF_FINAL
;
// nested types ----------------------------------------------------
...
...
@@ -1807,7 +1818,7 @@ class VarType_ChannelDesc
void
set_data_type
(
::
paddle_mobile
::
framework
::
proto
::
VarType_Type
value
);
// @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarType.ChannelDesc)
private:
private:
void
set_has_data_type
();
void
clear_has_data_type
();
void
set_has_capacity
();
...
...
@@ -1831,79 +1842,80 @@ class VarType_Tuple
MessageLite
/* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.VarType.Tuple)
*/
{
public:
public:
VarType_Tuple
();
virtual
~
VarType_Tuple
();
VarType_Tuple
(
const
VarType_Tuple
&
from
);
VarType_Tuple
(
const
VarType_Tuple
&
from
);
inline
VarType_Tuple
&
operator
=
(
const
VarType_Tuple
&
from
)
{
inline
VarType_Tuple
&
operator
=
(
const
VarType_Tuple
&
from
)
{
CopyFrom
(
from
);
return
*
this
;
}
#if LANG_CXX11
VarType_Tuple
(
VarType_Tuple
&&
from
)
noexcept
:
VarType_Tuple
()
{
VarType_Tuple
(
VarType_Tuple
&&
from
)
noexcept
:
VarType_Tuple
()
{
*
this
=
::
std
::
move
(
from
);
}
inline
VarType_Tuple
&
operator
=
(
VarType_Tuple
&&
from
)
noexcept
{
inline
VarType_Tuple
&
operator
=
(
VarType_Tuple
&&
from
)
noexcept
{
if
(
GetArenaNoVirtual
()
==
from
.
GetArenaNoVirtual
())
{
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
}
else
{
CopyFrom
(
from
);
}
return
*
this
;
}
#endif
inline
const
::
std
::
string
&
unknown_fields
()
const
{
inline
const
::
std
::
string
&
unknown_fields
()
const
{
return
_internal_metadata_
.
unknown_fields
();
}
inline
::
std
::
string
*
mutable_unknown_fields
()
{
inline
::
std
::
string
*
mutable_unknown_fields
()
{
return
_internal_metadata_
.
mutable_unknown_fields
();
}
static
const
VarType_Tuple
&
default_instance
();
static
const
VarType_Tuple
&
default_instance
();
static
inline
const
VarType_Tuple
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
VarType_Tuple
*>
(
static
inline
const
VarType_Tuple
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
VarType_Tuple
*>
(
&
_VarType_Tuple_default_instance_
);
}
static
PROTOBUF_CONSTEXPR
int
const
kIndexInFileMessages
=
11
;
void
Swap
(
VarType_Tuple
*
other
);
friend
void
swap
(
VarType_Tuple
&
a
,
VarType_Tuple
&
b
)
{
a
.
Swap
(
&
b
);
}
void
Swap
(
VarType_Tuple
*
other
);
friend
void
swap
(
VarType_Tuple
&
a
,
VarType_Tuple
&
b
)
{
a
.
Swap
(
&
b
);
}
// implements Message ----------------------------------------------
inline
VarType_Tuple
*
New
()
const
PROTOBUF_FINAL
{
return
New
(
NULL
);
}
inline
VarType_Tuple
*
New
()
const
PROTOBUF_FINAL
{
return
New
(
NULL
);
}
VarType_Tuple
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
VarType_Tuple
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
PROTOBUF_FINAL
;
void
CopyFrom
(
const
VarType_Tuple
&
from
);
void
MergeFrom
(
const
VarType_Tuple
&
from
);
void
CopyFrom
(
const
VarType_Tuple
&
from
);
void
MergeFrom
(
const
VarType_Tuple
&
from
);
void
Clear
()
PROTOBUF_FINAL
;
bool
IsInitialized
()
const
PROTOBUF_FINAL
;
size_t
ByteSizeLong
()
const
PROTOBUF_FINAL
;
bool
MergePartialFromCodedStream
(
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
void
SerializeWithCachedSizes
(
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
void
DiscardUnknownFields
();
int
GetCachedSize
()
const
PROTOBUF_FINAL
{
return
_cached_size_
;
}
private:
private:
void
SharedCtor
();
void
SharedDtor
();
void
SetCachedSize
(
int
size
)
const
;
void
InternalSwap
(
VarType_Tuple
*
other
);
void
InternalSwap
(
VarType_Tuple
*
other
);
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
public:
public:
::
std
::
string
GetTypeName
()
const
PROTOBUF_FINAL
;
// nested types ----------------------------------------------------
...
...
@@ -1918,11 +1930,11 @@ class VarType_Tuple
void
set_element_type
(
int
index
,
::
paddle_mobile
::
framework
::
proto
::
VarType_Type
value
);
void
add_element_type
(
::
paddle_mobile
::
framework
::
proto
::
VarType_Type
value
);
const
::
google
::
protobuf
::
RepeatedField
<
int
>
&
element_type
()
const
;
::
google
::
protobuf
::
RepeatedField
<
int
>
*
mutable_element_type
();
const
::
google
::
protobuf
::
RepeatedField
<
int
>
&
element_type
()
const
;
::
google
::
protobuf
::
RepeatedField
<
int
>
*
mutable_element_type
();
// @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarType.Tuple)
private:
private:
::
google
::
protobuf
::
internal
::
InternalMetadataWithArenaLite
_internal_metadata_
;
::
google
::
protobuf
::
internal
::
HasBits
<
1
>
_has_bits_
;
...
...
@@ -1937,76 +1949,77 @@ class VarType
MessageLite
/* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.VarType)
*/
{
public:
public:
VarType
();
virtual
~
VarType
();
VarType
(
const
VarType
&
from
);
VarType
(
const
VarType
&
from
);
inline
VarType
&
operator
=
(
const
VarType
&
from
)
{
inline
VarType
&
operator
=
(
const
VarType
&
from
)
{
CopyFrom
(
from
);
return
*
this
;
}
#if LANG_CXX11
VarType
(
VarType
&&
from
)
noexcept
:
VarType
()
{
*
this
=
::
std
::
move
(
from
);
}
VarType
(
VarType
&&
from
)
noexcept
:
VarType
()
{
*
this
=
::
std
::
move
(
from
);
}
inline
VarType
&
operator
=
(
VarType
&&
from
)
noexcept
{
inline
VarType
&
operator
=
(
VarType
&&
from
)
noexcept
{
if
(
GetArenaNoVirtual
()
==
from
.
GetArenaNoVirtual
())
{
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
}
else
{
CopyFrom
(
from
);
}
return
*
this
;
}
#endif
inline
const
::
std
::
string
&
unknown_fields
()
const
{
inline
const
::
std
::
string
&
unknown_fields
()
const
{
return
_internal_metadata_
.
unknown_fields
();
}
inline
::
std
::
string
*
mutable_unknown_fields
()
{
inline
::
std
::
string
*
mutable_unknown_fields
()
{
return
_internal_metadata_
.
mutable_unknown_fields
();
}
static
const
VarType
&
default_instance
();
static
const
VarType
&
default_instance
();
static
inline
const
VarType
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
VarType
*>
(
&
_VarType_default_instance_
);
static
inline
const
VarType
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
VarType
*>
(
&
_VarType_default_instance_
);
}
static
PROTOBUF_CONSTEXPR
int
const
kIndexInFileMessages
=
12
;
void
Swap
(
VarType
*
other
);
friend
void
swap
(
VarType
&
a
,
VarType
&
b
)
{
a
.
Swap
(
&
b
);
}
void
Swap
(
VarType
*
other
);
friend
void
swap
(
VarType
&
a
,
VarType
&
b
)
{
a
.
Swap
(
&
b
);
}
// implements Message ----------------------------------------------
inline
VarType
*
New
()
const
PROTOBUF_FINAL
{
return
New
(
NULL
);
}
inline
VarType
*
New
()
const
PROTOBUF_FINAL
{
return
New
(
NULL
);
}
VarType
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
VarType
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
PROTOBUF_FINAL
;
void
CopyFrom
(
const
VarType
&
from
);
void
MergeFrom
(
const
VarType
&
from
);
void
CopyFrom
(
const
VarType
&
from
);
void
MergeFrom
(
const
VarType
&
from
);
void
Clear
()
PROTOBUF_FINAL
;
bool
IsInitialized
()
const
PROTOBUF_FINAL
;
size_t
ByteSizeLong
()
const
PROTOBUF_FINAL
;
bool
MergePartialFromCodedStream
(
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
void
SerializeWithCachedSizes
(
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
void
DiscardUnknownFields
();
int
GetCachedSize
()
const
PROTOBUF_FINAL
{
return
_cached_size_
;
}
private:
private:
void
SharedCtor
();
void
SharedDtor
();
void
SetCachedSize
(
int
size
)
const
;
void
InternalSwap
(
VarType
*
other
);
void
InternalSwap
(
VarType
*
other
);
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
public:
public:
::
std
::
string
GetTypeName
()
const
PROTOBUF_FINAL
;
// nested types ----------------------------------------------------
...
...
@@ -2052,73 +2065,73 @@ class VarType
bool
has_selected_rows
()
const
;
void
clear_selected_rows
();
static
const
int
kSelectedRowsFieldNumber
=
2
;
const
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
&
selected_rows
()
const
;
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
const
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
&
selected_rows
()
const
;
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
mutable_selected_rows
();
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
release_selected_rows
();
void
set_allocated_selected_rows
(
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
selected_rows
);
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
selected_rows
);
// optional .paddle_mobile.framework.proto.VarType.LoDTensorDesc lod_tensor =
// 3;
bool
has_lod_tensor
()
const
;
void
clear_lod_tensor
();
static
const
int
kLodTensorFieldNumber
=
3
;
const
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
&
lod_tensor
()
const
;
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
*
const
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
&
lod_tensor
()
const
;
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
*
mutable_lod_tensor
();
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
*
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
*
release_lod_tensor
();
void
set_allocated_lod_tensor
(
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
*
lod_tensor
);
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
*
lod_tensor
);
// optional .paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc
// tensor_array = 4;
bool
has_tensor_array
()
const
;
void
clear_tensor_array
();
static
const
int
kTensorArrayFieldNumber
=
4
;
const
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorArrayDesc
&
const
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorArrayDesc
&
tensor_array
()
const
;
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorArrayDesc
*
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorArrayDesc
*
mutable_tensor_array
();
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorArrayDesc
*
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorArrayDesc
*
release_tensor_array
();
void
set_allocated_tensor_array
(
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorArrayDesc
*
tensor_array
);
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorArrayDesc
*
tensor_array
);
// optional .paddle_mobile.framework.proto.VarType.ReaderDesc reader = 5;
bool
has_reader
()
const
;
void
clear_reader
();
static
const
int
kReaderFieldNumber
=
5
;
const
::
paddle_mobile
::
framework
::
proto
::
VarType_ReaderDesc
&
reader
()
const
;
::
paddle_mobile
::
framework
::
proto
::
VarType_ReaderDesc
*
mutable_reader
();
::
paddle_mobile
::
framework
::
proto
::
VarType_ReaderDesc
*
release_reader
();
const
::
paddle_mobile
::
framework
::
proto
::
VarType_ReaderDesc
&
reader
()
const
;
::
paddle_mobile
::
framework
::
proto
::
VarType_ReaderDesc
*
mutable_reader
();
::
paddle_mobile
::
framework
::
proto
::
VarType_ReaderDesc
*
release_reader
();
void
set_allocated_reader
(
::
paddle_mobile
::
framework
::
proto
::
VarType_ReaderDesc
*
reader
);
::
paddle_mobile
::
framework
::
proto
::
VarType_ReaderDesc
*
reader
);
// optional .paddle_mobile.framework.proto.VarType.ChannelDesc channel = 6;
bool
has_channel
()
const
;
void
clear_channel
();
static
const
int
kChannelFieldNumber
=
6
;
const
::
paddle_mobile
::
framework
::
proto
::
VarType_ChannelDesc
&
channel
()
const
;
::
paddle_mobile
::
framework
::
proto
::
VarType_ChannelDesc
*
mutable_channel
();
::
paddle_mobile
::
framework
::
proto
::
VarType_ChannelDesc
*
release_channel
();
const
::
paddle_mobile
::
framework
::
proto
::
VarType_ChannelDesc
&
channel
()
const
;
::
paddle_mobile
::
framework
::
proto
::
VarType_ChannelDesc
*
mutable_channel
();
::
paddle_mobile
::
framework
::
proto
::
VarType_ChannelDesc
*
release_channel
();
void
set_allocated_channel
(
::
paddle_mobile
::
framework
::
proto
::
VarType_ChannelDesc
*
channel
);
::
paddle_mobile
::
framework
::
proto
::
VarType_ChannelDesc
*
channel
);
// optional .paddle_mobile.framework.proto.VarType.Tuple tuple = 7;
bool
has_tuple
()
const
;
void
clear_tuple
();
static
const
int
kTupleFieldNumber
=
7
;
const
::
paddle_mobile
::
framework
::
proto
::
VarType_Tuple
&
tuple
()
const
;
::
paddle_mobile
::
framework
::
proto
::
VarType_Tuple
*
mutable_tuple
();
::
paddle_mobile
::
framework
::
proto
::
VarType_Tuple
*
release_tuple
();
void
set_allocated_tuple
(
::
paddle_mobile
::
framework
::
proto
::
VarType_Tuple
*
tuple
);
const
::
paddle_mobile
::
framework
::
proto
::
VarType_Tuple
&
tuple
()
const
;
::
paddle_mobile
::
framework
::
proto
::
VarType_Tuple
*
mutable_tuple
();
::
paddle_mobile
::
framework
::
proto
::
VarType_Tuple
*
release_tuple
();
void
set_allocated_tuple
(
::
paddle_mobile
::
framework
::
proto
::
VarType_Tuple
*
tuple
);
// required .paddle_mobile.framework.proto.VarType.Type type = 1;
bool
has_type
()
const
;
...
...
@@ -2128,7 +2141,7 @@ class VarType
void
set_type
(
::
paddle_mobile
::
framework
::
proto
::
VarType_Type
value
);
// @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarType)
private:
private:
void
set_has_type
();
void
clear_has_type
();
void
set_has_selected_rows
();
...
...
@@ -2148,12 +2161,12 @@ class VarType
_internal_metadata_
;
::
google
::
protobuf
::
internal
::
HasBits
<
1
>
_has_bits_
;
mutable
int
_cached_size_
;
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
selected_rows_
;
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
*
lod_tensor_
;
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorArrayDesc
*
tensor_array_
;
::
paddle_mobile
::
framework
::
proto
::
VarType_ReaderDesc
*
reader_
;
::
paddle_mobile
::
framework
::
proto
::
VarType_ChannelDesc
*
channel_
;
::
paddle_mobile
::
framework
::
proto
::
VarType_Tuple
*
tuple_
;
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
selected_rows_
;
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
*
lod_tensor_
;
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorArrayDesc
*
tensor_array_
;
::
paddle_mobile
::
framework
::
proto
::
VarType_ReaderDesc
*
reader_
;
::
paddle_mobile
::
framework
::
proto
::
VarType_ChannelDesc
*
channel_
;
::
paddle_mobile
::
framework
::
proto
::
VarType_Tuple
*
tuple_
;
int
type_
;
friend
struct
protobuf_framework_2eproto
::
TableStruct
;
};
...
...
@@ -2164,76 +2177,77 @@ class VarDesc
MessageLite
/* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.VarDesc)
*/
{
public:
public:
VarDesc
();
virtual
~
VarDesc
();
VarDesc
(
const
VarDesc
&
from
);
VarDesc
(
const
VarDesc
&
from
);
inline
VarDesc
&
operator
=
(
const
VarDesc
&
from
)
{
inline
VarDesc
&
operator
=
(
const
VarDesc
&
from
)
{
CopyFrom
(
from
);
return
*
this
;
}
#if LANG_CXX11
VarDesc
(
VarDesc
&&
from
)
noexcept
:
VarDesc
()
{
*
this
=
::
std
::
move
(
from
);
}
VarDesc
(
VarDesc
&&
from
)
noexcept
:
VarDesc
()
{
*
this
=
::
std
::
move
(
from
);
}
inline
VarDesc
&
operator
=
(
VarDesc
&&
from
)
noexcept
{
inline
VarDesc
&
operator
=
(
VarDesc
&&
from
)
noexcept
{
if
(
GetArenaNoVirtual
()
==
from
.
GetArenaNoVirtual
())
{
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
}
else
{
CopyFrom
(
from
);
}
return
*
this
;
}
#endif
inline
const
::
std
::
string
&
unknown_fields
()
const
{
inline
const
::
std
::
string
&
unknown_fields
()
const
{
return
_internal_metadata_
.
unknown_fields
();
}
inline
::
std
::
string
*
mutable_unknown_fields
()
{
inline
::
std
::
string
*
mutable_unknown_fields
()
{
return
_internal_metadata_
.
mutable_unknown_fields
();
}
static
const
VarDesc
&
default_instance
();
static
const
VarDesc
&
default_instance
();
static
inline
const
VarDesc
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
VarDesc
*>
(
&
_VarDesc_default_instance_
);
static
inline
const
VarDesc
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
VarDesc
*>
(
&
_VarDesc_default_instance_
);
}
static
PROTOBUF_CONSTEXPR
int
const
kIndexInFileMessages
=
13
;
void
Swap
(
VarDesc
*
other
);
friend
void
swap
(
VarDesc
&
a
,
VarDesc
&
b
)
{
a
.
Swap
(
&
b
);
}
void
Swap
(
VarDesc
*
other
);
friend
void
swap
(
VarDesc
&
a
,
VarDesc
&
b
)
{
a
.
Swap
(
&
b
);
}
// implements Message ----------------------------------------------
inline
VarDesc
*
New
()
const
PROTOBUF_FINAL
{
return
New
(
NULL
);
}
inline
VarDesc
*
New
()
const
PROTOBUF_FINAL
{
return
New
(
NULL
);
}
VarDesc
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
VarDesc
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
PROTOBUF_FINAL
;
void
CopyFrom
(
const
VarDesc
&
from
);
void
MergeFrom
(
const
VarDesc
&
from
);
void
CopyFrom
(
const
VarDesc
&
from
);
void
MergeFrom
(
const
VarDesc
&
from
);
void
Clear
()
PROTOBUF_FINAL
;
bool
IsInitialized
()
const
PROTOBUF_FINAL
;
size_t
ByteSizeLong
()
const
PROTOBUF_FINAL
;
bool
MergePartialFromCodedStream
(
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
void
SerializeWithCachedSizes
(
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
void
DiscardUnknownFields
();
int
GetCachedSize
()
const
PROTOBUF_FINAL
{
return
_cached_size_
;
}
private:
private:
void
SharedCtor
();
void
SharedDtor
();
void
SetCachedSize
(
int
size
)
const
;
void
InternalSwap
(
VarDesc
*
other
);
void
InternalSwap
(
VarDesc
*
other
);
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
public:
public:
::
std
::
string
GetTypeName
()
const
PROTOBUF_FINAL
;
// nested types ----------------------------------------------------
...
...
@@ -2244,25 +2258,25 @@ class VarDesc
bool
has_name
()
const
;
void
clear_name
();
static
const
int
kNameFieldNumber
=
1
;
const
::
std
::
string
&
name
()
const
;
void
set_name
(
const
::
std
::
string
&
value
);
const
::
std
::
string
&
name
()
const
;
void
set_name
(
const
::
std
::
string
&
value
);
#if LANG_CXX11
void
set_name
(
::
std
::
string
&&
value
);
void
set_name
(
::
std
::
string
&&
value
);
#endif
void
set_name
(
const
char
*
value
);
void
set_name
(
const
char
*
value
,
size_t
size
);
::
std
::
string
*
mutable_name
();
::
std
::
string
*
release_name
();
void
set_allocated_name
(
::
std
::
string
*
name
);
void
set_name
(
const
char
*
value
);
void
set_name
(
const
char
*
value
,
size_t
size
);
::
std
::
string
*
mutable_name
();
::
std
::
string
*
release_name
();
void
set_allocated_name
(
::
std
::
string
*
name
);
// required .paddle_mobile.framework.proto.VarType type = 2;
bool
has_type
()
const
;
void
clear_type
();
static
const
int
kTypeFieldNumber
=
2
;
const
::
paddle_mobile
::
framework
::
proto
::
VarType
&
type
()
const
;
::
paddle_mobile
::
framework
::
proto
::
VarType
*
mutable_type
();
::
paddle_mobile
::
framework
::
proto
::
VarType
*
release_type
();
void
set_allocated_type
(
::
paddle_mobile
::
framework
::
proto
::
VarType
*
type
);
const
::
paddle_mobile
::
framework
::
proto
::
VarType
&
type
()
const
;
::
paddle_mobile
::
framework
::
proto
::
VarType
*
mutable_type
();
::
paddle_mobile
::
framework
::
proto
::
VarType
*
release_type
();
void
set_allocated_type
(
::
paddle_mobile
::
framework
::
proto
::
VarType
*
type
);
// optional bool persistable = 3 [default = false];
bool
has_persistable
()
const
;
...
...
@@ -2272,7 +2286,7 @@ class VarDesc
void
set_persistable
(
bool
value
);
// @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarDesc)
private:
private:
void
set_has_name
();
void
clear_has_name
();
void
set_has_type
();
...
...
@@ -2288,7 +2302,7 @@ class VarDesc
::
google
::
protobuf
::
internal
::
HasBits
<
1
>
_has_bits_
;
mutable
int
_cached_size_
;
::
google
::
protobuf
::
internal
::
ArenaStringPtr
name_
;
::
paddle_mobile
::
framework
::
proto
::
VarType
*
type_
;
::
paddle_mobile
::
framework
::
proto
::
VarType
*
type_
;
bool
persistable_
;
friend
struct
protobuf_framework_2eproto
::
TableStruct
;
};
...
...
@@ -2299,78 +2313,79 @@ class BlockDesc
MessageLite
/* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.BlockDesc)
*/
{
public:
public:
BlockDesc
();
virtual
~
BlockDesc
();
BlockDesc
(
const
BlockDesc
&
from
);
BlockDesc
(
const
BlockDesc
&
from
);
inline
BlockDesc
&
operator
=
(
const
BlockDesc
&
from
)
{
inline
BlockDesc
&
operator
=
(
const
BlockDesc
&
from
)
{
CopyFrom
(
from
);
return
*
this
;
}
#if LANG_CXX11
BlockDesc
(
BlockDesc
&&
from
)
noexcept
:
BlockDesc
()
{
BlockDesc
(
BlockDesc
&&
from
)
noexcept
:
BlockDesc
()
{
*
this
=
::
std
::
move
(
from
);
}
inline
BlockDesc
&
operator
=
(
BlockDesc
&&
from
)
noexcept
{
inline
BlockDesc
&
operator
=
(
BlockDesc
&&
from
)
noexcept
{
if
(
GetArenaNoVirtual
()
==
from
.
GetArenaNoVirtual
())
{
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
}
else
{
CopyFrom
(
from
);
}
return
*
this
;
}
#endif
inline
const
::
std
::
string
&
unknown_fields
()
const
{
inline
const
::
std
::
string
&
unknown_fields
()
const
{
return
_internal_metadata_
.
unknown_fields
();
}
inline
::
std
::
string
*
mutable_unknown_fields
()
{
inline
::
std
::
string
*
mutable_unknown_fields
()
{
return
_internal_metadata_
.
mutable_unknown_fields
();
}
static
const
BlockDesc
&
default_instance
();
static
const
BlockDesc
&
default_instance
();
static
inline
const
BlockDesc
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
BlockDesc
*>
(
&
_BlockDesc_default_instance_
);
static
inline
const
BlockDesc
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
BlockDesc
*>
(
&
_BlockDesc_default_instance_
);
}
static
PROTOBUF_CONSTEXPR
int
const
kIndexInFileMessages
=
14
;
void
Swap
(
BlockDesc
*
other
);
friend
void
swap
(
BlockDesc
&
a
,
BlockDesc
&
b
)
{
a
.
Swap
(
&
b
);
}
void
Swap
(
BlockDesc
*
other
);
friend
void
swap
(
BlockDesc
&
a
,
BlockDesc
&
b
)
{
a
.
Swap
(
&
b
);
}
// implements Message ----------------------------------------------
inline
BlockDesc
*
New
()
const
PROTOBUF_FINAL
{
return
New
(
NULL
);
}
inline
BlockDesc
*
New
()
const
PROTOBUF_FINAL
{
return
New
(
NULL
);
}
BlockDesc
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
BlockDesc
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
PROTOBUF_FINAL
;
void
CopyFrom
(
const
BlockDesc
&
from
);
void
MergeFrom
(
const
BlockDesc
&
from
);
void
CopyFrom
(
const
BlockDesc
&
from
);
void
MergeFrom
(
const
BlockDesc
&
from
);
void
Clear
()
PROTOBUF_FINAL
;
bool
IsInitialized
()
const
PROTOBUF_FINAL
;
size_t
ByteSizeLong
()
const
PROTOBUF_FINAL
;
bool
MergePartialFromCodedStream
(
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
void
SerializeWithCachedSizes
(
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
void
DiscardUnknownFields
();
int
GetCachedSize
()
const
PROTOBUF_FINAL
{
return
_cached_size_
;
}
private:
private:
void
SharedCtor
();
void
SharedDtor
();
void
SetCachedSize
(
int
size
)
const
;
void
InternalSwap
(
BlockDesc
*
other
);
void
InternalSwap
(
BlockDesc
*
other
);
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
public:
public:
::
std
::
string
GetTypeName
()
const
PROTOBUF_FINAL
;
// nested types ----------------------------------------------------
...
...
@@ -2381,28 +2396,28 @@ class BlockDesc
int
vars_size
()
const
;
void
clear_vars
();
static
const
int
kVarsFieldNumber
=
3
;
const
::
paddle_mobile
::
framework
::
proto
::
VarDesc
&
vars
(
int
index
)
const
;
::
paddle_mobile
::
framework
::
proto
::
VarDesc
*
mutable_vars
(
int
index
);
::
paddle_mobile
::
framework
::
proto
::
VarDesc
*
add_vars
();
const
::
paddle_mobile
::
framework
::
proto
::
VarDesc
&
vars
(
int
index
)
const
;
::
paddle_mobile
::
framework
::
proto
::
VarDesc
*
mutable_vars
(
int
index
);
::
paddle_mobile
::
framework
::
proto
::
VarDesc
*
add_vars
();
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
VarDesc
>*
::
paddle_mobile
::
framework
::
proto
::
VarDesc
>
*
mutable_vars
();
const
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
VarDesc
>&
::
paddle_mobile
::
framework
::
proto
::
VarDesc
>
&
vars
()
const
;
// repeated .paddle_mobile.framework.proto.OpDesc ops = 4;
int
ops_size
()
const
;
void
clear_ops
();
static
const
int
kOpsFieldNumber
=
4
;
const
::
paddle_mobile
::
framework
::
proto
::
OpDesc
&
ops
(
int
index
)
const
;
::
paddle_mobile
::
framework
::
proto
::
OpDesc
*
mutable_ops
(
int
index
);
::
paddle_mobile
::
framework
::
proto
::
OpDesc
*
add_ops
();
const
::
paddle_mobile
::
framework
::
proto
::
OpDesc
&
ops
(
int
index
)
const
;
::
paddle_mobile
::
framework
::
proto
::
OpDesc
*
mutable_ops
(
int
index
);
::
paddle_mobile
::
framework
::
proto
::
OpDesc
*
add_ops
();
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
OpDesc
>*
::
paddle_mobile
::
framework
::
proto
::
OpDesc
>
*
mutable_ops
();
const
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
OpDesc
>&
::
paddle_mobile
::
framework
::
proto
::
OpDesc
>
&
ops
()
const
;
// required int32 idx = 1;
...
...
@@ -2427,7 +2442,7 @@ class BlockDesc
void
set_forward_block_idx
(
::
google
::
protobuf
::
int32
value
);
// @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.BlockDesc)
private:
private:
void
set_has_idx
();
void
clear_has_idx
();
void
set_has_parent_idx
();
...
...
@@ -2460,79 +2475,80 @@ class ProgramDesc
MessageLite
/* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.ProgramDesc)
*/
{
public:
public:
ProgramDesc
();
virtual
~
ProgramDesc
();
ProgramDesc
(
const
ProgramDesc
&
from
);
ProgramDesc
(
const
ProgramDesc
&
from
);
inline
ProgramDesc
&
operator
=
(
const
ProgramDesc
&
from
)
{
inline
ProgramDesc
&
operator
=
(
const
ProgramDesc
&
from
)
{
CopyFrom
(
from
);
return
*
this
;
}
#if LANG_CXX11
ProgramDesc
(
ProgramDesc
&&
from
)
noexcept
:
ProgramDesc
()
{
ProgramDesc
(
ProgramDesc
&&
from
)
noexcept
:
ProgramDesc
()
{
*
this
=
::
std
::
move
(
from
);
}
inline
ProgramDesc
&
operator
=
(
ProgramDesc
&&
from
)
noexcept
{
inline
ProgramDesc
&
operator
=
(
ProgramDesc
&&
from
)
noexcept
{
if
(
GetArenaNoVirtual
()
==
from
.
GetArenaNoVirtual
())
{
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
if
(
this
!=
&
from
)
InternalSwap
(
&
from
);
}
else
{
CopyFrom
(
from
);
}
return
*
this
;
}
#endif
inline
const
::
std
::
string
&
unknown_fields
()
const
{
inline
const
::
std
::
string
&
unknown_fields
()
const
{
return
_internal_metadata_
.
unknown_fields
();
}
inline
::
std
::
string
*
mutable_unknown_fields
()
{
inline
::
std
::
string
*
mutable_unknown_fields
()
{
return
_internal_metadata_
.
mutable_unknown_fields
();
}
static
const
ProgramDesc
&
default_instance
();
static
const
ProgramDesc
&
default_instance
();
static
inline
const
ProgramDesc
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
ProgramDesc
*>
(
static
inline
const
ProgramDesc
*
internal_default_instance
()
{
return
reinterpret_cast
<
const
ProgramDesc
*>
(
&
_ProgramDesc_default_instance_
);
}
static
PROTOBUF_CONSTEXPR
int
const
kIndexInFileMessages
=
15
;
void
Swap
(
ProgramDesc
*
other
);
friend
void
swap
(
ProgramDesc
&
a
,
ProgramDesc
&
b
)
{
a
.
Swap
(
&
b
);
}
void
Swap
(
ProgramDesc
*
other
);
friend
void
swap
(
ProgramDesc
&
a
,
ProgramDesc
&
b
)
{
a
.
Swap
(
&
b
);
}
// implements Message ----------------------------------------------
inline
ProgramDesc
*
New
()
const
PROTOBUF_FINAL
{
return
New
(
NULL
);
}
inline
ProgramDesc
*
New
()
const
PROTOBUF_FINAL
{
return
New
(
NULL
);
}
ProgramDesc
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
ProgramDesc
*
New
(
::
google
::
protobuf
::
Arena
*
arena
)
const
PROTOBUF_FINAL
;
void
CheckTypeAndMergeFrom
(
const
::
google
::
protobuf
::
MessageLite
&
from
)
PROTOBUF_FINAL
;
void
CopyFrom
(
const
ProgramDesc
&
from
);
void
MergeFrom
(
const
ProgramDesc
&
from
);
void
CopyFrom
(
const
ProgramDesc
&
from
);
void
MergeFrom
(
const
ProgramDesc
&
from
);
void
Clear
()
PROTOBUF_FINAL
;
bool
IsInitialized
()
const
PROTOBUF_FINAL
;
size_t
ByteSizeLong
()
const
PROTOBUF_FINAL
;
bool
MergePartialFromCodedStream
(
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedInputStream
*
input
)
PROTOBUF_FINAL
;
void
SerializeWithCachedSizes
(
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
::
google
::
protobuf
::
io
::
CodedOutputStream
*
output
)
const
PROTOBUF_FINAL
;
void
DiscardUnknownFields
();
int
GetCachedSize
()
const
PROTOBUF_FINAL
{
return
_cached_size_
;
}
private:
private:
void
SharedCtor
();
void
SharedDtor
();
void
SetCachedSize
(
int
size
)
const
;
void
InternalSwap
(
ProgramDesc
*
other
);
void
InternalSwap
(
ProgramDesc
*
other
);
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
private:
inline
::
google
::
protobuf
::
Arena
*
GetArenaNoVirtual
()
const
{
return
NULL
;
}
inline
void
*
MaybeArenaPtr
()
const
{
return
NULL
;
}
public:
public:
::
std
::
string
GetTypeName
()
const
PROTOBUF_FINAL
;
// nested types ----------------------------------------------------
...
...
@@ -2543,18 +2559,18 @@ class ProgramDesc
int
blocks_size
()
const
;
void
clear_blocks
();
static
const
int
kBlocksFieldNumber
=
1
;
const
::
paddle_mobile
::
framework
::
proto
::
BlockDesc
&
blocks
(
int
index
)
const
;
::
paddle_mobile
::
framework
::
proto
::
BlockDesc
*
mutable_blocks
(
int
index
);
::
paddle_mobile
::
framework
::
proto
::
BlockDesc
*
add_blocks
();
const
::
paddle_mobile
::
framework
::
proto
::
BlockDesc
&
blocks
(
int
index
)
const
;
::
paddle_mobile
::
framework
::
proto
::
BlockDesc
*
mutable_blocks
(
int
index
);
::
paddle_mobile
::
framework
::
proto
::
BlockDesc
*
add_blocks
();
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
BlockDesc
>*
::
paddle_mobile
::
framework
::
proto
::
BlockDesc
>
*
mutable_blocks
();
const
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
BlockDesc
>&
::
paddle_mobile
::
framework
::
proto
::
BlockDesc
>
&
blocks
()
const
;
// @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.ProgramDesc)
private:
private:
::
google
::
protobuf
::
internal
::
InternalMetadataWithArenaLite
_internal_metadata_
;
::
google
::
protobuf
::
internal
::
HasBits
<
1
>
_has_bits_
;
...
...
@@ -2572,7 +2588,7 @@ class ProgramDesc
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif
// __GNUC__
#endif // __GNUC__
// OpDesc_Attr
// required string name = 1;
...
...
@@ -2586,50 +2602,50 @@ inline void OpDesc_Attr::clear_name() {
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
clear_has_name
();
}
inline
const
::
std
::
string
&
OpDesc_Attr
::
name
()
const
{
inline
const
::
std
::
string
&
OpDesc_Attr
::
name
()
const
{
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.name)
return
name_
.
GetNoArena
();
}
inline
void
OpDesc_Attr
::
set_name
(
const
::
std
::
string
&
value
)
{
inline
void
OpDesc_Attr
::
set_name
(
const
::
std
::
string
&
value
)
{
set_has_name
();
name_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
value
);
// @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.name)
}
#if LANG_CXX11
inline
void
OpDesc_Attr
::
set_name
(
::
std
::
string
&&
value
)
{
inline
void
OpDesc_Attr
::
set_name
(
::
std
::
string
&&
value
)
{
set_has_name
();
name_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
::
std
::
move
(
value
));
// @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpDesc.Attr.name)
}
#endif
inline
void
OpDesc_Attr
::
set_name
(
const
char
*
value
)
{
inline
void
OpDesc_Attr
::
set_name
(
const
char
*
value
)
{
GOOGLE_DCHECK
(
value
!=
NULL
);
set_has_name
();
name_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
::
std
::
string
(
value
));
// @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpDesc.Attr.name)
}
inline
void
OpDesc_Attr
::
set_name
(
const
char
*
value
,
size_t
size
)
{
inline
void
OpDesc_Attr
::
set_name
(
const
char
*
value
,
size_t
size
)
{
set_has_name
();
name_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
::
std
::
string
(
reinterpret_cast
<
const
char
*>
(
value
),
size
));
::
std
::
string
(
reinterpret_cast
<
const
char
*>
(
value
),
size
));
// @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpDesc.Attr.name)
}
inline
::
std
::
string
*
OpDesc_Attr
::
mutable_name
()
{
inline
::
std
::
string
*
OpDesc_Attr
::
mutable_name
()
{
set_has_name
();
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.Attr.name)
return
name_
.
MutableNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
}
inline
::
std
::
string
*
OpDesc_Attr
::
release_name
()
{
inline
::
std
::
string
*
OpDesc_Attr
::
release_name
()
{
// @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpDesc.Attr.name)
clear_has_name
();
return
name_
.
ReleaseNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
}
inline
void
OpDesc_Attr
::
set_allocated_name
(
::
std
::
string
*
name
)
{
inline
void
OpDesc_Attr
::
set_allocated_name
(
::
std
::
string
*
name
)
{
if
(
name
!=
NULL
)
{
set_has_name
();
}
else
{
...
...
@@ -2654,8 +2670,8 @@ inline ::paddle_mobile::framework::proto::AttrType OpDesc_Attr::type() const {
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.type)
return
static_cast
<::
paddle_mobile
::
framework
::
proto
::
AttrType
>
(
type_
);
}
inline
void
OpDesc_Attr
::
set_type
(
::
paddle_mobile
::
framework
::
proto
::
AttrType
value
)
{
inline
void
OpDesc_Attr
::
set_type
(
::
paddle_mobile
::
framework
::
proto
::
AttrType
value
)
{
assert
(
::
paddle_mobile
::
framework
::
proto
::
AttrType_IsValid
(
value
));
set_has_type
();
type_
=
value
;
...
...
@@ -2713,50 +2729,50 @@ inline void OpDesc_Attr::clear_s() {
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
clear_has_s
();
}
inline
const
::
std
::
string
&
OpDesc_Attr
::
s
()
const
{
inline
const
::
std
::
string
&
OpDesc_Attr
::
s
()
const
{
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.s)
return
s_
.
GetNoArena
();
}
inline
void
OpDesc_Attr
::
set_s
(
const
::
std
::
string
&
value
)
{
inline
void
OpDesc_Attr
::
set_s
(
const
::
std
::
string
&
value
)
{
set_has_s
();
s_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
value
);
// @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.s)
}
#if LANG_CXX11
inline
void
OpDesc_Attr
::
set_s
(
::
std
::
string
&&
value
)
{
inline
void
OpDesc_Attr
::
set_s
(
::
std
::
string
&&
value
)
{
set_has_s
();
s_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
::
std
::
move
(
value
));
// @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpDesc.Attr.s)
}
#endif
inline
void
OpDesc_Attr
::
set_s
(
const
char
*
value
)
{
inline
void
OpDesc_Attr
::
set_s
(
const
char
*
value
)
{
GOOGLE_DCHECK
(
value
!=
NULL
);
set_has_s
();
s_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
::
std
::
string
(
value
));
// @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpDesc.Attr.s)
}
inline
void
OpDesc_Attr
::
set_s
(
const
char
*
value
,
size_t
size
)
{
inline
void
OpDesc_Attr
::
set_s
(
const
char
*
value
,
size_t
size
)
{
set_has_s
();
s_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
::
std
::
string
(
reinterpret_cast
<
const
char
*>
(
value
),
size
));
::
std
::
string
(
reinterpret_cast
<
const
char
*>
(
value
),
size
));
// @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpDesc.Attr.s)
}
inline
::
std
::
string
*
OpDesc_Attr
::
mutable_s
()
{
inline
::
std
::
string
*
OpDesc_Attr
::
mutable_s
()
{
set_has_s
();
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.Attr.s)
return
s_
.
MutableNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
}
inline
::
std
::
string
*
OpDesc_Attr
::
release_s
()
{
inline
::
std
::
string
*
OpDesc_Attr
::
release_s
()
{
// @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpDesc.Attr.s)
clear_has_s
();
return
s_
.
ReleaseNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
}
inline
void
OpDesc_Attr
::
set_allocated_s
(
::
std
::
string
*
s
)
{
inline
void
OpDesc_Attr
::
set_allocated_s
(
::
std
::
string
*
s
)
{
if
(
s
!=
NULL
)
{
set_has_s
();
}
else
{
...
...
@@ -2782,12 +2798,12 @@ inline void OpDesc_Attr::add_ints(::google::protobuf::int32 value) {
ints_
.
Add
(
value
);
// @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Attr.ints)
}
inline
const
::
google
::
protobuf
::
RepeatedField
<::
google
::
protobuf
::
int32
>&
inline
const
::
google
::
protobuf
::
RepeatedField
<::
google
::
protobuf
::
int32
>
&
OpDesc_Attr
::
ints
()
const
{
// @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Attr.ints)
return
ints_
;
}
inline
::
google
::
protobuf
::
RepeatedField
<::
google
::
protobuf
::
int32
>*
inline
::
google
::
protobuf
::
RepeatedField
<::
google
::
protobuf
::
int32
>
*
OpDesc_Attr
::
mutable_ints
()
{
// @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.Attr.ints)
return
&
ints_
;
...
...
@@ -2808,12 +2824,12 @@ inline void OpDesc_Attr::add_floats(float value) {
floats_
.
Add
(
value
);
// @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Attr.floats)
}
inline
const
::
google
::
protobuf
::
RepeatedField
<
float
>
&
OpDesc_Attr
::
floats
()
const
{
inline
const
::
google
::
protobuf
::
RepeatedField
<
float
>
&
OpDesc_Attr
::
floats
()
const
{
// @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Attr.floats)
return
floats_
;
}
inline
::
google
::
protobuf
::
RepeatedField
<
float
>
*
OpDesc_Attr
::
mutable_floats
()
{
inline
::
google
::
protobuf
::
RepeatedField
<
float
>
*
OpDesc_Attr
::
mutable_floats
()
{
// @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.Attr.floats)
return
&
floats_
;
}
...
...
@@ -2821,63 +2837,63 @@ inline ::google::protobuf::RepeatedField<float>* OpDesc_Attr::mutable_floats() {
// repeated string strings = 8;
inline
int
OpDesc_Attr
::
strings_size
()
const
{
return
strings_
.
size
();
}
inline
void
OpDesc_Attr
::
clear_strings
()
{
strings_
.
Clear
();
}
inline
const
::
std
::
string
&
OpDesc_Attr
::
strings
(
int
index
)
const
{
inline
const
::
std
::
string
&
OpDesc_Attr
::
strings
(
int
index
)
const
{
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.strings)
return
strings_
.
Get
(
index
);
}
inline
::
std
::
string
*
OpDesc_Attr
::
mutable_strings
(
int
index
)
{
inline
::
std
::
string
*
OpDesc_Attr
::
mutable_strings
(
int
index
)
{
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.Attr.strings)
return
strings_
.
Mutable
(
index
);
}
inline
void
OpDesc_Attr
::
set_strings
(
int
index
,
const
::
std
::
string
&
value
)
{
inline
void
OpDesc_Attr
::
set_strings
(
int
index
,
const
::
std
::
string
&
value
)
{
// @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.strings)
strings_
.
Mutable
(
index
)
->
assign
(
value
);
}
#if LANG_CXX11
inline
void
OpDesc_Attr
::
set_strings
(
int
index
,
::
std
::
string
&&
value
)
{
inline
void
OpDesc_Attr
::
set_strings
(
int
index
,
::
std
::
string
&&
value
)
{
// @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.strings)
strings_
.
Mutable
(
index
)
->
assign
(
std
::
move
(
value
));
}
#endif
inline
void
OpDesc_Attr
::
set_strings
(
int
index
,
const
char
*
value
)
{
inline
void
OpDesc_Attr
::
set_strings
(
int
index
,
const
char
*
value
)
{
GOOGLE_DCHECK
(
value
!=
NULL
);
strings_
.
Mutable
(
index
)
->
assign
(
value
);
// @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpDesc.Attr.strings)
}
inline
void
OpDesc_Attr
::
set_strings
(
int
index
,
const
char
*
value
,
inline
void
OpDesc_Attr
::
set_strings
(
int
index
,
const
char
*
value
,
size_t
size
)
{
strings_
.
Mutable
(
index
)
->
assign
(
reinterpret_cast
<
const
char
*>
(
value
),
size
);
strings_
.
Mutable
(
index
)
->
assign
(
reinterpret_cast
<
const
char
*>
(
value
),
size
);
// @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpDesc.Attr.strings)
}
inline
::
std
::
string
*
OpDesc_Attr
::
add_strings
()
{
inline
::
std
::
string
*
OpDesc_Attr
::
add_strings
()
{
// @@protoc_insertion_point(field_add_mutable:paddle_mobile.framework.proto.OpDesc.Attr.strings)
return
strings_
.
Add
();
}
inline
void
OpDesc_Attr
::
add_strings
(
const
::
std
::
string
&
value
)
{
inline
void
OpDesc_Attr
::
add_strings
(
const
::
std
::
string
&
value
)
{
strings_
.
Add
()
->
assign
(
value
);
// @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Attr.strings)
}
#if LANG_CXX11
inline
void
OpDesc_Attr
::
add_strings
(
::
std
::
string
&&
value
)
{
inline
void
OpDesc_Attr
::
add_strings
(
::
std
::
string
&&
value
)
{
strings_
.
Add
(
std
::
move
(
value
));
// @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Attr.strings)
}
#endif
inline
void
OpDesc_Attr
::
add_strings
(
const
char
*
value
)
{
inline
void
OpDesc_Attr
::
add_strings
(
const
char
*
value
)
{
GOOGLE_DCHECK
(
value
!=
NULL
);
strings_
.
Add
()
->
assign
(
value
);
// @@protoc_insertion_point(field_add_char:paddle_mobile.framework.proto.OpDesc.Attr.strings)
}
inline
void
OpDesc_Attr
::
add_strings
(
const
char
*
value
,
size_t
size
)
{
strings_
.
Add
()
->
assign
(
reinterpret_cast
<
const
char
*>
(
value
),
size
);
inline
void
OpDesc_Attr
::
add_strings
(
const
char
*
value
,
size_t
size
)
{
strings_
.
Add
()
->
assign
(
reinterpret_cast
<
const
char
*>
(
value
),
size
);
// @@protoc_insertion_point(field_add_pointer:paddle_mobile.framework.proto.OpDesc.Attr.strings)
}
inline
const
::
google
::
protobuf
::
RepeatedPtrField
<::
std
::
string
>&
inline
const
::
google
::
protobuf
::
RepeatedPtrField
<::
std
::
string
>
&
OpDesc_Attr
::
strings
()
const
{
// @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Attr.strings)
return
strings_
;
}
inline
::
google
::
protobuf
::
RepeatedPtrField
<::
std
::
string
>*
inline
::
google
::
protobuf
::
RepeatedPtrField
<::
std
::
string
>
*
OpDesc_Attr
::
mutable_strings
()
{
// @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.Attr.strings)
return
&
strings_
;
...
...
@@ -2918,12 +2934,12 @@ inline void OpDesc_Attr::add_bools(bool value) {
bools_
.
Add
(
value
);
// @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Attr.bools)
}
inline
const
::
google
::
protobuf
::
RepeatedField
<
bool
>
&
OpDesc_Attr
::
bools
()
const
{
inline
const
::
google
::
protobuf
::
RepeatedField
<
bool
>
&
OpDesc_Attr
::
bools
()
const
{
// @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Attr.bools)
return
bools_
;
}
inline
::
google
::
protobuf
::
RepeatedField
<
bool
>
*
OpDesc_Attr
::
mutable_bools
()
{
inline
::
google
::
protobuf
::
RepeatedField
<
bool
>
*
OpDesc_Attr
::
mutable_bools
()
{
// @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.Attr.bools)
return
&
bools_
;
}
...
...
@@ -2985,18 +3001,18 @@ inline void OpDesc_Var::clear_parameter() {
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
clear_has_parameter
();
}
inline
const
::
std
::
string
&
OpDesc_Var
::
parameter
()
const
{
inline
const
::
std
::
string
&
OpDesc_Var
::
parameter
()
const
{
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Var.parameter)
return
parameter_
.
GetNoArena
();
}
inline
void
OpDesc_Var
::
set_parameter
(
const
::
std
::
string
&
value
)
{
inline
void
OpDesc_Var
::
set_parameter
(
const
::
std
::
string
&
value
)
{
set_has_parameter
();
parameter_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
value
);
// @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Var.parameter)
}
#if LANG_CXX11
inline
void
OpDesc_Var
::
set_parameter
(
::
std
::
string
&&
value
)
{
inline
void
OpDesc_Var
::
set_parameter
(
::
std
::
string
&&
value
)
{
set_has_parameter
();
parameter_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
...
...
@@ -3004,7 +3020,7 @@ inline void OpDesc_Var::set_parameter(::std::string&& value) {
// @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpDesc.Var.parameter)
}
#endif
inline
void
OpDesc_Var
::
set_parameter
(
const
char
*
value
)
{
inline
void
OpDesc_Var
::
set_parameter
(
const
char
*
value
)
{
GOOGLE_DCHECK
(
value
!=
NULL
);
set_has_parameter
();
parameter_
.
SetNoArena
(
...
...
@@ -3012,26 +3028,26 @@ inline void OpDesc_Var::set_parameter(const char* value) {
::
std
::
string
(
value
));
// @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpDesc.Var.parameter)
}
inline
void
OpDesc_Var
::
set_parameter
(
const
char
*
value
,
size_t
size
)
{
inline
void
OpDesc_Var
::
set_parameter
(
const
char
*
value
,
size_t
size
)
{
set_has_parameter
();
parameter_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
::
std
::
string
(
reinterpret_cast
<
const
char
*>
(
value
),
size
));
::
std
::
string
(
reinterpret_cast
<
const
char
*>
(
value
),
size
));
// @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpDesc.Var.parameter)
}
inline
::
std
::
string
*
OpDesc_Var
::
mutable_parameter
()
{
inline
::
std
::
string
*
OpDesc_Var
::
mutable_parameter
()
{
set_has_parameter
();
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.Var.parameter)
return
parameter_
.
MutableNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
}
inline
::
std
::
string
*
OpDesc_Var
::
release_parameter
()
{
inline
::
std
::
string
*
OpDesc_Var
::
release_parameter
()
{
// @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpDesc.Var.parameter)
clear_has_parameter
();
return
parameter_
.
ReleaseNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
}
inline
void
OpDesc_Var
::
set_allocated_parameter
(
::
std
::
string
*
parameter
)
{
inline
void
OpDesc_Var
::
set_allocated_parameter
(
::
std
::
string
*
parameter
)
{
if
(
parameter
!=
NULL
)
{
set_has_parameter
();
}
else
{
...
...
@@ -3045,63 +3061,64 @@ inline void OpDesc_Var::set_allocated_parameter(::std::string* parameter) {
// repeated string arguments = 2;
inline
int
OpDesc_Var
::
arguments_size
()
const
{
return
arguments_
.
size
();
}
inline
void
OpDesc_Var
::
clear_arguments
()
{
arguments_
.
Clear
();
}
inline
const
::
std
::
string
&
OpDesc_Var
::
arguments
(
int
index
)
const
{
inline
const
::
std
::
string
&
OpDesc_Var
::
arguments
(
int
index
)
const
{
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Var.arguments)
return
arguments_
.
Get
(
index
);
}
inline
::
std
::
string
*
OpDesc_Var
::
mutable_arguments
(
int
index
)
{
inline
::
std
::
string
*
OpDesc_Var
::
mutable_arguments
(
int
index
)
{
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.Var.arguments)
return
arguments_
.
Mutable
(
index
);
}
inline
void
OpDesc_Var
::
set_arguments
(
int
index
,
const
::
std
::
string
&
value
)
{
inline
void
OpDesc_Var
::
set_arguments
(
int
index
,
const
::
std
::
string
&
value
)
{
// @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Var.arguments)
arguments_
.
Mutable
(
index
)
->
assign
(
value
);
}
#if LANG_CXX11
inline
void
OpDesc_Var
::
set_arguments
(
int
index
,
::
std
::
string
&&
value
)
{
inline
void
OpDesc_Var
::
set_arguments
(
int
index
,
::
std
::
string
&&
value
)
{
// @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Var.arguments)
arguments_
.
Mutable
(
index
)
->
assign
(
std
::
move
(
value
));
}
#endif
inline
void
OpDesc_Var
::
set_arguments
(
int
index
,
const
char
*
value
)
{
inline
void
OpDesc_Var
::
set_arguments
(
int
index
,
const
char
*
value
)
{
GOOGLE_DCHECK
(
value
!=
NULL
);
arguments_
.
Mutable
(
index
)
->
assign
(
value
);
// @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpDesc.Var.arguments)
}
inline
void
OpDesc_Var
::
set_arguments
(
int
index
,
const
char
*
value
,
inline
void
OpDesc_Var
::
set_arguments
(
int
index
,
const
char
*
value
,
size_t
size
)
{
arguments_
.
Mutable
(
index
)
->
assign
(
reinterpret_cast
<
const
char
*>
(
value
),
size
);
arguments_
.
Mutable
(
index
)
->
assign
(
reinterpret_cast
<
const
char
*>
(
value
),
size
);
// @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpDesc.Var.arguments)
}
inline
::
std
::
string
*
OpDesc_Var
::
add_arguments
()
{
inline
::
std
::
string
*
OpDesc_Var
::
add_arguments
()
{
// @@protoc_insertion_point(field_add_mutable:paddle_mobile.framework.proto.OpDesc.Var.arguments)
return
arguments_
.
Add
();
}
inline
void
OpDesc_Var
::
add_arguments
(
const
::
std
::
string
&
value
)
{
inline
void
OpDesc_Var
::
add_arguments
(
const
::
std
::
string
&
value
)
{
arguments_
.
Add
()
->
assign
(
value
);
// @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Var.arguments)
}
#if LANG_CXX11
inline
void
OpDesc_Var
::
add_arguments
(
::
std
::
string
&&
value
)
{
inline
void
OpDesc_Var
::
add_arguments
(
::
std
::
string
&&
value
)
{
arguments_
.
Add
(
std
::
move
(
value
));
// @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Var.arguments)
}
#endif
inline
void
OpDesc_Var
::
add_arguments
(
const
char
*
value
)
{
inline
void
OpDesc_Var
::
add_arguments
(
const
char
*
value
)
{
GOOGLE_DCHECK
(
value
!=
NULL
);
arguments_
.
Add
()
->
assign
(
value
);
// @@protoc_insertion_point(field_add_char:paddle_mobile.framework.proto.OpDesc.Var.arguments)
}
inline
void
OpDesc_Var
::
add_arguments
(
const
char
*
value
,
size_t
size
)
{
arguments_
.
Add
()
->
assign
(
reinterpret_cast
<
const
char
*>
(
value
),
size
);
inline
void
OpDesc_Var
::
add_arguments
(
const
char
*
value
,
size_t
size
)
{
arguments_
.
Add
()
->
assign
(
reinterpret_cast
<
const
char
*>
(
value
),
size
);
// @@protoc_insertion_point(field_add_pointer:paddle_mobile.framework.proto.OpDesc.Var.arguments)
}
inline
const
::
google
::
protobuf
::
RepeatedPtrField
<::
std
::
string
>&
inline
const
::
google
::
protobuf
::
RepeatedPtrField
<::
std
::
string
>
&
OpDesc_Var
::
arguments
()
const
{
// @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Var.arguments)
return
arguments_
;
}
inline
::
google
::
protobuf
::
RepeatedPtrField
<::
std
::
string
>*
inline
::
google
::
protobuf
::
RepeatedPtrField
<::
std
::
string
>
*
OpDesc_Var
::
mutable_arguments
()
{
// @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.Var.arguments)
return
&
arguments_
;
...
...
@@ -3122,50 +3139,50 @@ inline void OpDesc::clear_type() {
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
clear_has_type
();
}
inline
const
::
std
::
string
&
OpDesc
::
type
()
const
{
inline
const
::
std
::
string
&
OpDesc
::
type
()
const
{
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.type)
return
type_
.
GetNoArena
();
}
inline
void
OpDesc
::
set_type
(
const
::
std
::
string
&
value
)
{
inline
void
OpDesc
::
set_type
(
const
::
std
::
string
&
value
)
{
set_has_type
();
type_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
value
);
// @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.type)
}
#if LANG_CXX11
inline
void
OpDesc
::
set_type
(
::
std
::
string
&&
value
)
{
inline
void
OpDesc
::
set_type
(
::
std
::
string
&&
value
)
{
set_has_type
();
type_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
::
std
::
move
(
value
));
// @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpDesc.type)
}
#endif
inline
void
OpDesc
::
set_type
(
const
char
*
value
)
{
inline
void
OpDesc
::
set_type
(
const
char
*
value
)
{
GOOGLE_DCHECK
(
value
!=
NULL
);
set_has_type
();
type_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
::
std
::
string
(
value
));
// @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpDesc.type)
}
inline
void
OpDesc
::
set_type
(
const
char
*
value
,
size_t
size
)
{
inline
void
OpDesc
::
set_type
(
const
char
*
value
,
size_t
size
)
{
set_has_type
();
type_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
::
std
::
string
(
reinterpret_cast
<
const
char
*>
(
value
),
size
));
::
std
::
string
(
reinterpret_cast
<
const
char
*>
(
value
),
size
));
// @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpDesc.type)
}
inline
::
std
::
string
*
OpDesc
::
mutable_type
()
{
inline
::
std
::
string
*
OpDesc
::
mutable_type
()
{
set_has_type
();
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.type)
return
type_
.
MutableNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
}
inline
::
std
::
string
*
OpDesc
::
release_type
()
{
inline
::
std
::
string
*
OpDesc
::
release_type
()
{
// @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpDesc.type)
clear_has_type
();
return
type_
.
ReleaseNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
}
inline
void
OpDesc
::
set_allocated_type
(
::
std
::
string
*
type
)
{
inline
void
OpDesc
::
set_allocated_type
(
::
std
::
string
*
type
)
{
if
(
type
!=
NULL
)
{
set_has_type
();
}
else
{
...
...
@@ -3179,28 +3196,28 @@ inline void OpDesc::set_allocated_type(::std::string* type) {
// repeated .paddle_mobile.framework.proto.OpDesc.Var inputs = 1;
inline
int
OpDesc
::
inputs_size
()
const
{
return
inputs_
.
size
();
}
inline
void
OpDesc
::
clear_inputs
()
{
inputs_
.
Clear
();
}
inline
const
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
&
OpDesc
::
inputs
(
int
index
)
const
{
inline
const
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
&
OpDesc
::
inputs
(
int
index
)
const
{
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.inputs)
return
inputs_
.
Get
(
index
);
}
inline
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
*
OpDesc
::
mutable_inputs
(
int
index
)
{
inline
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
*
OpDesc
::
mutable_inputs
(
int
index
)
{
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.inputs)
return
inputs_
.
Mutable
(
index
);
}
inline
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
*
OpDesc
::
add_inputs
()
{
inline
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
*
OpDesc
::
add_inputs
()
{
// @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.inputs)
return
inputs_
.
Add
();
}
inline
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
>*
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
>
*
OpDesc
::
mutable_inputs
()
{
// @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.inputs)
return
&
inputs_
;
}
inline
const
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
>&
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
>
&
OpDesc
::
inputs
()
const
{
// @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.inputs)
return
inputs_
;
...
...
@@ -3209,28 +3226,28 @@ OpDesc::inputs() const {
// repeated .paddle_mobile.framework.proto.OpDesc.Var outputs = 2;
inline
int
OpDesc
::
outputs_size
()
const
{
return
outputs_
.
size
();
}
inline
void
OpDesc
::
clear_outputs
()
{
outputs_
.
Clear
();
}
inline
const
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
&
OpDesc
::
outputs
(
int
index
)
const
{
inline
const
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
&
OpDesc
::
outputs
(
int
index
)
const
{
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.outputs)
return
outputs_
.
Get
(
index
);
}
inline
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
*
OpDesc
::
mutable_outputs
(
int
index
)
{
inline
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
*
OpDesc
::
mutable_outputs
(
int
index
)
{
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.outputs)
return
outputs_
.
Mutable
(
index
);
}
inline
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
*
OpDesc
::
add_outputs
()
{
inline
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
*
OpDesc
::
add_outputs
()
{
// @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.outputs)
return
outputs_
.
Add
();
}
inline
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
>*
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
>
*
OpDesc
::
mutable_outputs
()
{
// @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.outputs)
return
&
outputs_
;
}
inline
const
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
>&
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Var
>
&
OpDesc
::
outputs
()
const
{
// @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.outputs)
return
outputs_
;
...
...
@@ -3239,28 +3256,28 @@ OpDesc::outputs() const {
// repeated .paddle_mobile.framework.proto.OpDesc.Attr attrs = 4;
inline
int
OpDesc
::
attrs_size
()
const
{
return
attrs_
.
size
();
}
inline
void
OpDesc
::
clear_attrs
()
{
attrs_
.
Clear
();
}
inline
const
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Attr
&
OpDesc
::
attrs
(
int
index
)
const
{
inline
const
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Attr
&
OpDesc
::
attrs
(
int
index
)
const
{
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.attrs)
return
attrs_
.
Get
(
index
);
}
inline
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Attr
*
OpDesc
::
mutable_attrs
(
int
index
)
{
inline
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Attr
*
OpDesc
::
mutable_attrs
(
int
index
)
{
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.attrs)
return
attrs_
.
Mutable
(
index
);
}
inline
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Attr
*
OpDesc
::
add_attrs
()
{
inline
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Attr
*
OpDesc
::
add_attrs
()
{
// @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.attrs)
return
attrs_
.
Add
();
}
inline
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Attr
>*
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Attr
>
*
OpDesc
::
mutable_attrs
()
{
// @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.attrs)
return
&
attrs_
;
}
inline
const
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Attr
>&
::
paddle_mobile
::
framework
::
proto
::
OpDesc_Attr
>
&
OpDesc
::
attrs
()
const
{
// @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.attrs)
return
attrs_
;
...
...
@@ -3301,50 +3318,50 @@ inline void OpProto_Var::clear_name() {
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
clear_has_name
();
}
inline
const
::
std
::
string
&
OpProto_Var
::
name
()
const
{
inline
const
::
std
::
string
&
OpProto_Var
::
name
()
const
{
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Var.name)
return
name_
.
GetNoArena
();
}
inline
void
OpProto_Var
::
set_name
(
const
::
std
::
string
&
value
)
{
inline
void
OpProto_Var
::
set_name
(
const
::
std
::
string
&
value
)
{
set_has_name
();
name_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
value
);
// @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Var.name)
}
#if LANG_CXX11
inline
void
OpProto_Var
::
set_name
(
::
std
::
string
&&
value
)
{
inline
void
OpProto_Var
::
set_name
(
::
std
::
string
&&
value
)
{
set_has_name
();
name_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
::
std
::
move
(
value
));
// @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpProto.Var.name)
}
#endif
inline
void
OpProto_Var
::
set_name
(
const
char
*
value
)
{
inline
void
OpProto_Var
::
set_name
(
const
char
*
value
)
{
GOOGLE_DCHECK
(
value
!=
NULL
);
set_has_name
();
name_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
::
std
::
string
(
value
));
// @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpProto.Var.name)
}
inline
void
OpProto_Var
::
set_name
(
const
char
*
value
,
size_t
size
)
{
inline
void
OpProto_Var
::
set_name
(
const
char
*
value
,
size_t
size
)
{
set_has_name
();
name_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
::
std
::
string
(
reinterpret_cast
<
const
char
*>
(
value
),
size
));
::
std
::
string
(
reinterpret_cast
<
const
char
*>
(
value
),
size
));
// @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpProto.Var.name)
}
inline
::
std
::
string
*
OpProto_Var
::
mutable_name
()
{
inline
::
std
::
string
*
OpProto_Var
::
mutable_name
()
{
set_has_name
();
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.Var.name)
return
name_
.
MutableNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
}
inline
::
std
::
string
*
OpProto_Var
::
release_name
()
{
inline
::
std
::
string
*
OpProto_Var
::
release_name
()
{
// @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpProto.Var.name)
clear_has_name
();
return
name_
.
ReleaseNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
}
inline
void
OpProto_Var
::
set_allocated_name
(
::
std
::
string
*
name
)
{
inline
void
OpProto_Var
::
set_allocated_name
(
::
std
::
string
*
name
)
{
if
(
name
!=
NULL
)
{
set_has_name
();
}
else
{
...
...
@@ -3366,18 +3383,18 @@ inline void OpProto_Var::clear_comment() {
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
clear_has_comment
();
}
inline
const
::
std
::
string
&
OpProto_Var
::
comment
()
const
{
inline
const
::
std
::
string
&
OpProto_Var
::
comment
()
const
{
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Var.comment)
return
comment_
.
GetNoArena
();
}
inline
void
OpProto_Var
::
set_comment
(
const
::
std
::
string
&
value
)
{
inline
void
OpProto_Var
::
set_comment
(
const
::
std
::
string
&
value
)
{
set_has_comment
();
comment_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
value
);
// @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Var.comment)
}
#if LANG_CXX11
inline
void
OpProto_Var
::
set_comment
(
::
std
::
string
&&
value
)
{
inline
void
OpProto_Var
::
set_comment
(
::
std
::
string
&&
value
)
{
set_has_comment
();
comment_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
...
...
@@ -3385,7 +3402,7 @@ inline void OpProto_Var::set_comment(::std::string&& value) {
// @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpProto.Var.comment)
}
#endif
inline
void
OpProto_Var
::
set_comment
(
const
char
*
value
)
{
inline
void
OpProto_Var
::
set_comment
(
const
char
*
value
)
{
GOOGLE_DCHECK
(
value
!=
NULL
);
set_has_comment
();
comment_
.
SetNoArena
(
...
...
@@ -3393,26 +3410,26 @@ inline void OpProto_Var::set_comment(const char* value) {
::
std
::
string
(
value
));
// @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpProto.Var.comment)
}
inline
void
OpProto_Var
::
set_comment
(
const
char
*
value
,
size_t
size
)
{
inline
void
OpProto_Var
::
set_comment
(
const
char
*
value
,
size_t
size
)
{
set_has_comment
();
comment_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
::
std
::
string
(
reinterpret_cast
<
const
char
*>
(
value
),
size
));
::
std
::
string
(
reinterpret_cast
<
const
char
*>
(
value
),
size
));
// @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpProto.Var.comment)
}
inline
::
std
::
string
*
OpProto_Var
::
mutable_comment
()
{
inline
::
std
::
string
*
OpProto_Var
::
mutable_comment
()
{
set_has_comment
();
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.Var.comment)
return
comment_
.
MutableNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
}
inline
::
std
::
string
*
OpProto_Var
::
release_comment
()
{
inline
::
std
::
string
*
OpProto_Var
::
release_comment
()
{
// @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpProto.Var.comment)
clear_has_comment
();
return
comment_
.
ReleaseNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
}
inline
void
OpProto_Var
::
set_allocated_comment
(
::
std
::
string
*
comment
)
{
inline
void
OpProto_Var
::
set_allocated_comment
(
::
std
::
string
*
comment
)
{
if
(
comment
!=
NULL
)
{
set_has_comment
();
}
else
{
...
...
@@ -3506,50 +3523,50 @@ inline void OpProto_Attr::clear_name() {
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
clear_has_name
();
}
inline
const
::
std
::
string
&
OpProto_Attr
::
name
()
const
{
inline
const
::
std
::
string
&
OpProto_Attr
::
name
()
const
{
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Attr.name)
return
name_
.
GetNoArena
();
}
inline
void
OpProto_Attr
::
set_name
(
const
::
std
::
string
&
value
)
{
inline
void
OpProto_Attr
::
set_name
(
const
::
std
::
string
&
value
)
{
set_has_name
();
name_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
value
);
// @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Attr.name)
}
#if LANG_CXX11
inline
void
OpProto_Attr
::
set_name
(
::
std
::
string
&&
value
)
{
inline
void
OpProto_Attr
::
set_name
(
::
std
::
string
&&
value
)
{
set_has_name
();
name_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
::
std
::
move
(
value
));
// @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpProto.Attr.name)
}
#endif
inline
void
OpProto_Attr
::
set_name
(
const
char
*
value
)
{
inline
void
OpProto_Attr
::
set_name
(
const
char
*
value
)
{
GOOGLE_DCHECK
(
value
!=
NULL
);
set_has_name
();
name_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
::
std
::
string
(
value
));
// @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpProto.Attr.name)
}
inline
void
OpProto_Attr
::
set_name
(
const
char
*
value
,
size_t
size
)
{
inline
void
OpProto_Attr
::
set_name
(
const
char
*
value
,
size_t
size
)
{
set_has_name
();
name_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
::
std
::
string
(
reinterpret_cast
<
const
char
*>
(
value
),
size
));
::
std
::
string
(
reinterpret_cast
<
const
char
*>
(
value
),
size
));
// @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpProto.Attr.name)
}
inline
::
std
::
string
*
OpProto_Attr
::
mutable_name
()
{
inline
::
std
::
string
*
OpProto_Attr
::
mutable_name
()
{
set_has_name
();
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.Attr.name)
return
name_
.
MutableNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
}
inline
::
std
::
string
*
OpProto_Attr
::
release_name
()
{
inline
::
std
::
string
*
OpProto_Attr
::
release_name
()
{
// @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpProto.Attr.name)
clear_has_name
();
return
name_
.
ReleaseNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
}
inline
void
OpProto_Attr
::
set_allocated_name
(
::
std
::
string
*
name
)
{
inline
void
OpProto_Attr
::
set_allocated_name
(
::
std
::
string
*
name
)
{
if
(
name
!=
NULL
)
{
set_has_name
();
}
else
{
...
...
@@ -3574,8 +3591,8 @@ inline ::paddle_mobile::framework::proto::AttrType OpProto_Attr::type() const {
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Attr.type)
return
static_cast
<::
paddle_mobile
::
framework
::
proto
::
AttrType
>
(
type_
);
}
inline
void
OpProto_Attr
::
set_type
(
::
paddle_mobile
::
framework
::
proto
::
AttrType
value
)
{
inline
void
OpProto_Attr
::
set_type
(
::
paddle_mobile
::
framework
::
proto
::
AttrType
value
)
{
assert
(
::
paddle_mobile
::
framework
::
proto
::
AttrType_IsValid
(
value
));
set_has_type
();
type_
=
value
;
...
...
@@ -3593,18 +3610,18 @@ inline void OpProto_Attr::clear_comment() {
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
clear_has_comment
();
}
inline
const
::
std
::
string
&
OpProto_Attr
::
comment
()
const
{
inline
const
::
std
::
string
&
OpProto_Attr
::
comment
()
const
{
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Attr.comment)
return
comment_
.
GetNoArena
();
}
inline
void
OpProto_Attr
::
set_comment
(
const
::
std
::
string
&
value
)
{
inline
void
OpProto_Attr
::
set_comment
(
const
::
std
::
string
&
value
)
{
set_has_comment
();
comment_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
value
);
// @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Attr.comment)
}
#if LANG_CXX11
inline
void
OpProto_Attr
::
set_comment
(
::
std
::
string
&&
value
)
{
inline
void
OpProto_Attr
::
set_comment
(
::
std
::
string
&&
value
)
{
set_has_comment
();
comment_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
...
...
@@ -3612,7 +3629,7 @@ inline void OpProto_Attr::set_comment(::std::string&& value) {
// @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpProto.Attr.comment)
}
#endif
inline
void
OpProto_Attr
::
set_comment
(
const
char
*
value
)
{
inline
void
OpProto_Attr
::
set_comment
(
const
char
*
value
)
{
GOOGLE_DCHECK
(
value
!=
NULL
);
set_has_comment
();
comment_
.
SetNoArena
(
...
...
@@ -3620,26 +3637,26 @@ inline void OpProto_Attr::set_comment(const char* value) {
::
std
::
string
(
value
));
// @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpProto.Attr.comment)
}
inline
void
OpProto_Attr
::
set_comment
(
const
char
*
value
,
size_t
size
)
{
inline
void
OpProto_Attr
::
set_comment
(
const
char
*
value
,
size_t
size
)
{
set_has_comment
();
comment_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
::
std
::
string
(
reinterpret_cast
<
const
char
*>
(
value
),
size
));
::
std
::
string
(
reinterpret_cast
<
const
char
*>
(
value
),
size
));
// @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpProto.Attr.comment)
}
inline
::
std
::
string
*
OpProto_Attr
::
mutable_comment
()
{
inline
::
std
::
string
*
OpProto_Attr
::
mutable_comment
()
{
set_has_comment
();
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.Attr.comment)
return
comment_
.
MutableNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
}
inline
::
std
::
string
*
OpProto_Attr
::
release_comment
()
{
inline
::
std
::
string
*
OpProto_Attr
::
release_comment
()
{
// @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpProto.Attr.comment)
clear_has_comment
();
return
comment_
.
ReleaseNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
}
inline
void
OpProto_Attr
::
set_allocated_comment
(
::
std
::
string
*
comment
)
{
inline
void
OpProto_Attr
::
set_allocated_comment
(
::
std
::
string
*
comment
)
{
if
(
comment
!=
NULL
)
{
set_has_comment
();
}
else
{
...
...
@@ -3687,50 +3704,50 @@ inline void OpProto::clear_type() {
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
clear_has_type
();
}
inline
const
::
std
::
string
&
OpProto
::
type
()
const
{
inline
const
::
std
::
string
&
OpProto
::
type
()
const
{
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.type)
return
type_
.
GetNoArena
();
}
inline
void
OpProto
::
set_type
(
const
::
std
::
string
&
value
)
{
inline
void
OpProto
::
set_type
(
const
::
std
::
string
&
value
)
{
set_has_type
();
type_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
value
);
// @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.type)
}
#if LANG_CXX11
inline
void
OpProto
::
set_type
(
::
std
::
string
&&
value
)
{
inline
void
OpProto
::
set_type
(
::
std
::
string
&&
value
)
{
set_has_type
();
type_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
::
std
::
move
(
value
));
// @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpProto.type)
}
#endif
inline
void
OpProto
::
set_type
(
const
char
*
value
)
{
inline
void
OpProto
::
set_type
(
const
char
*
value
)
{
GOOGLE_DCHECK
(
value
!=
NULL
);
set_has_type
();
type_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
::
std
::
string
(
value
));
// @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpProto.type)
}
inline
void
OpProto
::
set_type
(
const
char
*
value
,
size_t
size
)
{
inline
void
OpProto
::
set_type
(
const
char
*
value
,
size_t
size
)
{
set_has_type
();
type_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
::
std
::
string
(
reinterpret_cast
<
const
char
*>
(
value
),
size
));
::
std
::
string
(
reinterpret_cast
<
const
char
*>
(
value
),
size
));
// @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpProto.type)
}
inline
::
std
::
string
*
OpProto
::
mutable_type
()
{
inline
::
std
::
string
*
OpProto
::
mutable_type
()
{
set_has_type
();
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.type)
return
type_
.
MutableNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
}
inline
::
std
::
string
*
OpProto
::
release_type
()
{
inline
::
std
::
string
*
OpProto
::
release_type
()
{
// @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpProto.type)
clear_has_type
();
return
type_
.
ReleaseNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
}
inline
void
OpProto
::
set_allocated_type
(
::
std
::
string
*
type
)
{
inline
void
OpProto
::
set_allocated_type
(
::
std
::
string
*
type
)
{
if
(
type
!=
NULL
)
{
set_has_type
();
}
else
{
...
...
@@ -3744,28 +3761,28 @@ inline void OpProto::set_allocated_type(::std::string* type) {
// repeated .paddle_mobile.framework.proto.OpProto.Var inputs = 2;
inline
int
OpProto
::
inputs_size
()
const
{
return
inputs_
.
size
();
}
inline
void
OpProto
::
clear_inputs
()
{
inputs_
.
Clear
();
}
inline
const
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
&
OpProto
::
inputs
(
int
index
)
const
{
inline
const
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
&
OpProto
::
inputs
(
int
index
)
const
{
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.inputs)
return
inputs_
.
Get
(
index
);
}
inline
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
*
OpProto
::
mutable_inputs
(
int
index
)
{
inline
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
*
OpProto
::
mutable_inputs
(
int
index
)
{
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.inputs)
return
inputs_
.
Mutable
(
index
);
}
inline
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
*
OpProto
::
add_inputs
()
{
inline
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
*
OpProto
::
add_inputs
()
{
// @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpProto.inputs)
return
inputs_
.
Add
();
}
inline
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
>*
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
>
*
OpProto
::
mutable_inputs
()
{
// @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpProto.inputs)
return
&
inputs_
;
}
inline
const
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
>&
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
>
&
OpProto
::
inputs
()
const
{
// @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpProto.inputs)
return
inputs_
;
...
...
@@ -3774,28 +3791,28 @@ OpProto::inputs() const {
// repeated .paddle_mobile.framework.proto.OpProto.Var outputs = 3;
inline
int
OpProto
::
outputs_size
()
const
{
return
outputs_
.
size
();
}
inline
void
OpProto
::
clear_outputs
()
{
outputs_
.
Clear
();
}
inline
const
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
&
OpProto
::
outputs
(
int
index
)
const
{
inline
const
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
&
OpProto
::
outputs
(
int
index
)
const
{
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.outputs)
return
outputs_
.
Get
(
index
);
}
inline
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
*
OpProto
::
mutable_outputs
(
int
index
)
{
inline
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
*
OpProto
::
mutable_outputs
(
int
index
)
{
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.outputs)
return
outputs_
.
Mutable
(
index
);
}
inline
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
*
OpProto
::
add_outputs
()
{
inline
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
*
OpProto
::
add_outputs
()
{
// @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpProto.outputs)
return
outputs_
.
Add
();
}
inline
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
>*
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
>
*
OpProto
::
mutable_outputs
()
{
// @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpProto.outputs)
return
&
outputs_
;
}
inline
const
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
>&
::
paddle_mobile
::
framework
::
proto
::
OpProto_Var
>
&
OpProto
::
outputs
()
const
{
// @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpProto.outputs)
return
outputs_
;
...
...
@@ -3804,28 +3821,28 @@ OpProto::outputs() const {
// repeated .paddle_mobile.framework.proto.OpProto.Attr attrs = 4;
inline
int
OpProto
::
attrs_size
()
const
{
return
attrs_
.
size
();
}
inline
void
OpProto
::
clear_attrs
()
{
attrs_
.
Clear
();
}
inline
const
::
paddle_mobile
::
framework
::
proto
::
OpProto_Attr
&
OpProto
::
attrs
(
int
index
)
const
{
inline
const
::
paddle_mobile
::
framework
::
proto
::
OpProto_Attr
&
OpProto
::
attrs
(
int
index
)
const
{
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.attrs)
return
attrs_
.
Get
(
index
);
}
inline
::
paddle_mobile
::
framework
::
proto
::
OpProto_Attr
*
OpProto
::
mutable_attrs
(
int
index
)
{
inline
::
paddle_mobile
::
framework
::
proto
::
OpProto_Attr
*
OpProto
::
mutable_attrs
(
int
index
)
{
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.attrs)
return
attrs_
.
Mutable
(
index
);
}
inline
::
paddle_mobile
::
framework
::
proto
::
OpProto_Attr
*
OpProto
::
add_attrs
()
{
inline
::
paddle_mobile
::
framework
::
proto
::
OpProto_Attr
*
OpProto
::
add_attrs
()
{
// @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpProto.attrs)
return
attrs_
.
Add
();
}
inline
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
OpProto_Attr
>*
::
paddle_mobile
::
framework
::
proto
::
OpProto_Attr
>
*
OpProto
::
mutable_attrs
()
{
// @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpProto.attrs)
return
&
attrs_
;
}
inline
const
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
OpProto_Attr
>&
::
paddle_mobile
::
framework
::
proto
::
OpProto_Attr
>
&
OpProto
::
attrs
()
const
{
// @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpProto.attrs)
return
attrs_
;
...
...
@@ -3842,18 +3859,18 @@ inline void OpProto::clear_comment() {
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
clear_has_comment
();
}
inline
const
::
std
::
string
&
OpProto
::
comment
()
const
{
inline
const
::
std
::
string
&
OpProto
::
comment
()
const
{
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.comment)
return
comment_
.
GetNoArena
();
}
inline
void
OpProto
::
set_comment
(
const
::
std
::
string
&
value
)
{
inline
void
OpProto
::
set_comment
(
const
::
std
::
string
&
value
)
{
set_has_comment
();
comment_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
value
);
// @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.comment)
}
#if LANG_CXX11
inline
void
OpProto
::
set_comment
(
::
std
::
string
&&
value
)
{
inline
void
OpProto
::
set_comment
(
::
std
::
string
&&
value
)
{
set_has_comment
();
comment_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
...
...
@@ -3861,7 +3878,7 @@ inline void OpProto::set_comment(::std::string&& value) {
// @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpProto.comment)
}
#endif
inline
void
OpProto
::
set_comment
(
const
char
*
value
)
{
inline
void
OpProto
::
set_comment
(
const
char
*
value
)
{
GOOGLE_DCHECK
(
value
!=
NULL
);
set_has_comment
();
comment_
.
SetNoArena
(
...
...
@@ -3869,26 +3886,26 @@ inline void OpProto::set_comment(const char* value) {
::
std
::
string
(
value
));
// @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpProto.comment)
}
inline
void
OpProto
::
set_comment
(
const
char
*
value
,
size_t
size
)
{
inline
void
OpProto
::
set_comment
(
const
char
*
value
,
size_t
size
)
{
set_has_comment
();
comment_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
::
std
::
string
(
reinterpret_cast
<
const
char
*>
(
value
),
size
));
::
std
::
string
(
reinterpret_cast
<
const
char
*>
(
value
),
size
));
// @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpProto.comment)
}
inline
::
std
::
string
*
OpProto
::
mutable_comment
()
{
inline
::
std
::
string
*
OpProto
::
mutable_comment
()
{
set_has_comment
();
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.comment)
return
comment_
.
MutableNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
}
inline
::
std
::
string
*
OpProto
::
release_comment
()
{
inline
::
std
::
string
*
OpProto
::
release_comment
()
{
// @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpProto.comment)
clear_has_comment
();
return
comment_
.
ReleaseNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
}
inline
void
OpProto
::
set_allocated_comment
(
::
std
::
string
*
comment
)
{
inline
void
OpProto
::
set_allocated_comment
(
::
std
::
string
*
comment
)
{
if
(
comment
!=
NULL
)
{
set_has_comment
();
}
else
{
...
...
@@ -3947,12 +3964,12 @@ inline void VarType_TensorDesc::add_dims(::google::protobuf::int64 value) {
dims_
.
Add
(
value
);
// @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.VarType.TensorDesc.dims)
}
inline
const
::
google
::
protobuf
::
RepeatedField
<::
google
::
protobuf
::
int64
>&
inline
const
::
google
::
protobuf
::
RepeatedField
<::
google
::
protobuf
::
int64
>
&
VarType_TensorDesc
::
dims
()
const
{
// @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.VarType.TensorDesc.dims)
return
dims_
;
}
inline
::
google
::
protobuf
::
RepeatedField
<::
google
::
protobuf
::
int64
>*
inline
::
google
::
protobuf
::
RepeatedField
<::
google
::
protobuf
::
int64
>
*
VarType_TensorDesc
::
mutable_dims
()
{
// @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.VarType.TensorDesc.dims)
return
&
dims_
;
...
...
@@ -3977,16 +3994,18 @@ inline void VarType_LoDTensorDesc::clear_tensor() {
tensor_
->::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
::
Clear
();
clear_has_tensor
();
}
inline
const
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
&
inline
const
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
&
VarType_LoDTensorDesc
::
tensor
()
const
{
const
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
p
=
tensor_
;
const
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
p
=
tensor_
;
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.LoDTensorDesc.tensor)
return
p
!=
NULL
?
*
p
:
*
reinterpret_cast
<
const
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*>
(
&::
paddle_mobile
::
framework
::
proto
::
_VarType_TensorDesc_default_instance_
);
return
p
!=
NULL
?
*
p
:
*
reinterpret_cast
<
const
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*>
(
&::
paddle_mobile
::
framework
::
proto
::
_VarType_TensorDesc_default_instance_
);
}
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
VarType_LoDTensorDesc
::
mutable_tensor
()
{
set_has_tensor
();
if
(
tensor_
==
NULL
)
{
...
...
@@ -3995,16 +4014,16 @@ VarType_LoDTensorDesc::mutable_tensor() {
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.LoDTensorDesc.tensor)
return
tensor_
;
}
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
VarType_LoDTensorDesc
::
release_tensor
()
{
// @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.LoDTensorDesc.tensor)
clear_has_tensor
();
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
temp
=
tensor_
;
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
temp
=
tensor_
;
tensor_
=
NULL
;
return
temp
;
}
inline
void
VarType_LoDTensorDesc
::
set_allocated_tensor
(
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
tensor
)
{
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
tensor
)
{
delete
tensor_
;
tensor_
=
tensor
;
if
(
tensor
)
{
...
...
@@ -4033,8 +4052,8 @@ inline ::google::protobuf::int32 VarType_LoDTensorDesc::lod_level() const {
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.LoDTensorDesc.lod_level)
return
lod_level_
;
}
inline
void
VarType_LoDTensorDesc
::
set_lod_level
(
::
google
::
protobuf
::
int32
value
)
{
inline
void
VarType_LoDTensorDesc
::
set_lod_level
(
::
google
::
protobuf
::
int32
value
)
{
set_has_lod_level
();
lod_level_
=
value
;
// @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.LoDTensorDesc.lod_level)
...
...
@@ -4059,16 +4078,18 @@ inline void VarType_LoDTensorArrayDesc::clear_tensor() {
tensor_
->::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
::
Clear
();
clear_has_tensor
();
}
inline
const
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
&
inline
const
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
&
VarType_LoDTensorArrayDesc
::
tensor
()
const
{
const
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
p
=
tensor_
;
const
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
p
=
tensor_
;
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.tensor)
return
p
!=
NULL
?
*
p
:
*
reinterpret_cast
<
const
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*>
(
&::
paddle_mobile
::
framework
::
proto
::
_VarType_TensorDesc_default_instance_
);
return
p
!=
NULL
?
*
p
:
*
reinterpret_cast
<
const
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*>
(
&::
paddle_mobile
::
framework
::
proto
::
_VarType_TensorDesc_default_instance_
);
}
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
VarType_LoDTensorArrayDesc
::
mutable_tensor
()
{
set_has_tensor
();
if
(
tensor_
==
NULL
)
{
...
...
@@ -4077,16 +4098,16 @@ VarType_LoDTensorArrayDesc::mutable_tensor() {
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.tensor)
return
tensor_
;
}
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
VarType_LoDTensorArrayDesc
::
release_tensor
()
{
// @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.tensor)
clear_has_tensor
();
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
temp
=
tensor_
;
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
temp
=
tensor_
;
tensor_
=
NULL
;
return
temp
;
}
inline
void
VarType_LoDTensorArrayDesc
::
set_allocated_tensor
(
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
tensor
)
{
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
tensor
)
{
delete
tensor_
;
tensor_
=
tensor
;
if
(
tensor
)
{
...
...
@@ -4115,8 +4136,8 @@ inline ::google::protobuf::int32 VarType_LoDTensorArrayDesc::lod_level() const {
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.lod_level)
return
lod_level_
;
}
inline
void
VarType_LoDTensorArrayDesc
::
set_lod_level
(
::
google
::
protobuf
::
int32
value
)
{
inline
void
VarType_LoDTensorArrayDesc
::
set_lod_level
(
::
google
::
protobuf
::
int32
value
)
{
set_has_lod_level
();
lod_level_
=
value
;
// @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.lod_level)
...
...
@@ -4131,29 +4152,29 @@ inline int VarType_ReaderDesc::lod_tensor_size() const {
return
lod_tensor_
.
size
();
}
inline
void
VarType_ReaderDesc
::
clear_lod_tensor
()
{
lod_tensor_
.
Clear
();
}
inline
const
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
&
inline
const
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
&
VarType_ReaderDesc
::
lod_tensor
(
int
index
)
const
{
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.ReaderDesc.lod_tensor)
return
lod_tensor_
.
Get
(
index
);
}
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
*
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
*
VarType_ReaderDesc
::
mutable_lod_tensor
(
int
index
)
{
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.ReaderDesc.lod_tensor)
return
lod_tensor_
.
Mutable
(
index
);
}
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
*
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
*
VarType_ReaderDesc
::
add_lod_tensor
()
{
// @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.VarType.ReaderDesc.lod_tensor)
return
lod_tensor_
.
Add
();
}
inline
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
>*
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
>
*
VarType_ReaderDesc
::
mutable_lod_tensor
()
{
// @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.VarType.ReaderDesc.lod_tensor)
return
&
lod_tensor_
;
}
inline
const
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
>&
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
>
&
VarType_ReaderDesc
::
lod_tensor
()
const
{
// @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.VarType.ReaderDesc.lod_tensor)
return
lod_tensor_
;
...
...
@@ -4242,12 +4263,12 @@ inline void VarType_Tuple::add_element_type(
element_type_
.
Add
(
value
);
// @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.VarType.Tuple.element_type)
}
inline
const
::
google
::
protobuf
::
RepeatedField
<
int
>&
inline
const
::
google
::
protobuf
::
RepeatedField
<
int
>
&
VarType_Tuple
::
element_type
()
const
{
// @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.VarType.Tuple.element_type)
return
element_type_
;
}
inline
::
google
::
protobuf
::
RepeatedField
<
int
>*
inline
::
google
::
protobuf
::
RepeatedField
<
int
>
*
VarType_Tuple
::
mutable_element_type
()
{
// @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.VarType.Tuple.element_type)
return
&
element_type_
;
...
...
@@ -4271,8 +4292,8 @@ inline ::paddle_mobile::framework::proto::VarType_Type VarType::type() const {
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.type)
return
static_cast
<::
paddle_mobile
::
framework
::
proto
::
VarType_Type
>
(
type_
);
}
inline
void
VarType
::
set_type
(
::
paddle_mobile
::
framework
::
proto
::
VarType_Type
value
)
{
inline
void
VarType
::
set_type
(
::
paddle_mobile
::
framework
::
proto
::
VarType_Type
value
)
{
assert
(
::
paddle_mobile
::
framework
::
proto
::
VarType_Type_IsValid
(
value
));
set_has_type
();
type_
=
value
;
...
...
@@ -4293,17 +4314,19 @@ inline void VarType::clear_selected_rows() {
->::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
::
Clear
();
clear_has_selected_rows
();
}
inline
const
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
&
inline
const
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
&
VarType
::
selected_rows
()
const
{
const
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
p
=
const
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
p
=
selected_rows_
;
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.selected_rows)
return
p
!=
NULL
?
*
p
:
*
reinterpret_cast
<
const
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*>
(
&::
paddle_mobile
::
framework
::
proto
::
_VarType_TensorDesc_default_instance_
);
return
p
!=
NULL
?
*
p
:
*
reinterpret_cast
<
const
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*>
(
&::
paddle_mobile
::
framework
::
proto
::
_VarType_TensorDesc_default_instance_
);
}
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
VarType
::
mutable_selected_rows
()
{
set_has_selected_rows
();
if
(
selected_rows_
==
NULL
)
{
...
...
@@ -4312,16 +4335,16 @@ VarType::mutable_selected_rows() {
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.selected_rows)
return
selected_rows_
;
}
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
VarType
::
release_selected_rows
()
{
// @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.selected_rows)
clear_has_selected_rows
();
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
temp
=
selected_rows_
;
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
temp
=
selected_rows_
;
selected_rows_
=
NULL
;
return
temp
;
}
inline
void
VarType
::
set_allocated_selected_rows
(
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
selected_rows
)
{
::
paddle_mobile
::
framework
::
proto
::
VarType_TensorDesc
*
selected_rows
)
{
delete
selected_rows_
;
selected_rows_
=
selected_rows
;
if
(
selected_rows
)
{
...
...
@@ -4344,17 +4367,17 @@ inline void VarType::clear_lod_tensor() {
->::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
::
Clear
();
clear_has_lod_tensor
();
}
inline
const
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
&
inline
const
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
&
VarType
::
lod_tensor
()
const
{
const
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
*
p
=
const
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
*
p
=
lod_tensor_
;
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.lod_tensor)
return
p
!=
NULL
?
*
p
:
*
reinterpret_cast
<
const
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
*>
(
proto
::
VarType_LoDTensorDesc
*>
(
&::
paddle_mobile
::
framework
::
proto
::
_VarType_LoDTensorDesc_default_instance_
);
}
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
*
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
*
VarType
::
mutable_lod_tensor
()
{
set_has_lod_tensor
();
if
(
lod_tensor_
==
NULL
)
{
...
...
@@ -4363,16 +4386,16 @@ VarType::mutable_lod_tensor() {
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.lod_tensor)
return
lod_tensor_
;
}
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
*
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
*
VarType
::
release_lod_tensor
()
{
// @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.lod_tensor)
clear_has_lod_tensor
();
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
*
temp
=
lod_tensor_
;
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
*
temp
=
lod_tensor_
;
lod_tensor_
=
NULL
;
return
temp
;
}
inline
void
VarType
::
set_allocated_lod_tensor
(
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
*
lod_tensor
)
{
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorDesc
*
lod_tensor
)
{
delete
lod_tensor_
;
lod_tensor_
=
lod_tensor
;
if
(
lod_tensor
)
{
...
...
@@ -4396,18 +4419,18 @@ inline void VarType::clear_tensor_array() {
VarType_LoDTensorArrayDesc
::
Clear
();
clear_has_tensor_array
();
}
inline
const
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorArrayDesc
&
inline
const
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorArrayDesc
&
VarType
::
tensor_array
()
const
{
const
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorArrayDesc
*
p
=
const
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorArrayDesc
*
p
=
tensor_array_
;
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.tensor_array)
return
p
!=
NULL
?
*
p
:
*
reinterpret_cast
<
const
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorArrayDesc
*>
(
VarType_LoDTensorArrayDesc
*>
(
&::
paddle_mobile
::
framework
::
proto
::
_VarType_LoDTensorArrayDesc_default_instance_
);
}
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorArrayDesc
*
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorArrayDesc
*
VarType
::
mutable_tensor_array
()
{
set_has_tensor_array
();
if
(
tensor_array_
==
NULL
)
{
...
...
@@ -4417,18 +4440,18 @@ VarType::mutable_tensor_array() {
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.tensor_array)
return
tensor_array_
;
}
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorArrayDesc
*
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorArrayDesc
*
VarType
::
release_tensor_array
()
{
// @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.tensor_array)
clear_has_tensor_array
();
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorArrayDesc
*
temp
=
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorArrayDesc
*
temp
=
tensor_array_
;
tensor_array_
=
NULL
;
return
temp
;
}
inline
void
VarType
::
set_allocated_tensor_array
(
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorArrayDesc
*
tensor_array
)
{
::
paddle_mobile
::
framework
::
proto
::
VarType_LoDTensorArrayDesc
*
tensor_array
)
{
delete
tensor_array_
;
tensor_array_
=
tensor_array
;
if
(
tensor_array
)
{
...
...
@@ -4450,16 +4473,18 @@ inline void VarType::clear_reader() {
reader_
->::
paddle_mobile
::
framework
::
proto
::
VarType_ReaderDesc
::
Clear
();
clear_has_reader
();
}
inline
const
::
paddle_mobile
::
framework
::
proto
::
VarType_ReaderDesc
&
inline
const
::
paddle_mobile
::
framework
::
proto
::
VarType_ReaderDesc
&
VarType
::
reader
()
const
{
const
::
paddle_mobile
::
framework
::
proto
::
VarType_ReaderDesc
*
p
=
reader_
;
const
::
paddle_mobile
::
framework
::
proto
::
VarType_ReaderDesc
*
p
=
reader_
;
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.reader)
return
p
!=
NULL
?
*
p
:
*
reinterpret_cast
<
const
::
paddle_mobile
::
framework
::
proto
::
VarType_ReaderDesc
*>
(
&::
paddle_mobile
::
framework
::
proto
::
_VarType_ReaderDesc_default_instance_
);
return
p
!=
NULL
?
*
p
:
*
reinterpret_cast
<
const
::
paddle_mobile
::
framework
::
proto
::
VarType_ReaderDesc
*>
(
&::
paddle_mobile
::
framework
::
proto
::
_VarType_ReaderDesc_default_instance_
);
}
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_ReaderDesc
*
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_ReaderDesc
*
VarType
::
mutable_reader
()
{
set_has_reader
();
if
(
reader_
==
NULL
)
{
...
...
@@ -4468,16 +4493,16 @@ VarType::mutable_reader() {
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.reader)
return
reader_
;
}
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_ReaderDesc
*
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_ReaderDesc
*
VarType
::
release_reader
()
{
// @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.reader)
clear_has_reader
();
::
paddle_mobile
::
framework
::
proto
::
VarType_ReaderDesc
*
temp
=
reader_
;
::
paddle_mobile
::
framework
::
proto
::
VarType_ReaderDesc
*
temp
=
reader_
;
reader_
=
NULL
;
return
temp
;
}
inline
void
VarType
::
set_allocated_reader
(
::
paddle_mobile
::
framework
::
proto
::
VarType_ReaderDesc
*
reader
)
{
::
paddle_mobile
::
framework
::
proto
::
VarType_ReaderDesc
*
reader
)
{
delete
reader_
;
reader_
=
reader
;
if
(
reader
)
{
...
...
@@ -4499,16 +4524,18 @@ inline void VarType::clear_channel() {
channel_
->::
paddle_mobile
::
framework
::
proto
::
VarType_ChannelDesc
::
Clear
();
clear_has_channel
();
}
inline
const
::
paddle_mobile
::
framework
::
proto
::
VarType_ChannelDesc
&
inline
const
::
paddle_mobile
::
framework
::
proto
::
VarType_ChannelDesc
&
VarType
::
channel
()
const
{
const
::
paddle_mobile
::
framework
::
proto
::
VarType_ChannelDesc
*
p
=
channel_
;
const
::
paddle_mobile
::
framework
::
proto
::
VarType_ChannelDesc
*
p
=
channel_
;
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.channel)
return
p
!=
NULL
?
*
p
:
*
reinterpret_cast
<
const
::
paddle_mobile
::
framework
::
proto
::
VarType_ChannelDesc
*>
(
&::
paddle_mobile
::
framework
::
proto
::
_VarType_ChannelDesc_default_instance_
);
return
p
!=
NULL
?
*
p
:
*
reinterpret_cast
<
const
::
paddle_mobile
::
framework
::
proto
::
VarType_ChannelDesc
*>
(
&::
paddle_mobile
::
framework
::
proto
::
_VarType_ChannelDesc_default_instance_
);
}
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_ChannelDesc
*
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_ChannelDesc
*
VarType
::
mutable_channel
()
{
set_has_channel
();
if
(
channel_
==
NULL
)
{
...
...
@@ -4517,16 +4544,16 @@ VarType::mutable_channel() {
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.channel)
return
channel_
;
}
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_ChannelDesc
*
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_ChannelDesc
*
VarType
::
release_channel
()
{
// @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.channel)
clear_has_channel
();
::
paddle_mobile
::
framework
::
proto
::
VarType_ChannelDesc
*
temp
=
channel_
;
::
paddle_mobile
::
framework
::
proto
::
VarType_ChannelDesc
*
temp
=
channel_
;
channel_
=
NULL
;
return
temp
;
}
inline
void
VarType
::
set_allocated_channel
(
::
paddle_mobile
::
framework
::
proto
::
VarType_ChannelDesc
*
channel
)
{
::
paddle_mobile
::
framework
::
proto
::
VarType_ChannelDesc
*
channel
)
{
delete
channel_
;
channel_
=
channel
;
if
(
channel
)
{
...
...
@@ -4548,18 +4575,18 @@ inline void VarType::clear_tuple() {
tuple_
->::
paddle_mobile
::
framework
::
proto
::
VarType_Tuple
::
Clear
();
clear_has_tuple
();
}
inline
const
::
paddle_mobile
::
framework
::
proto
::
VarType_Tuple
&
VarType
::
tuple
()
const
{
const
::
paddle_mobile
::
framework
::
proto
::
VarType_Tuple
*
p
=
tuple_
;
inline
const
::
paddle_mobile
::
framework
::
proto
::
VarType_Tuple
&
VarType
::
tuple
()
const
{
const
::
paddle_mobile
::
framework
::
proto
::
VarType_Tuple
*
p
=
tuple_
;
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.tuple)
return
p
!=
NULL
?
*
p
:
*
reinterpret_cast
<
const
::
paddle_mobile
::
framework
::
proto
::
VarType_Tuple
*>
(
const
::
paddle_mobile
::
framework
::
proto
::
VarType_Tuple
*>
(
&::
paddle_mobile
::
framework
::
proto
::
_VarType_Tuple_default_instance_
);
}
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_Tuple
*
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_Tuple
*
VarType
::
mutable_tuple
()
{
set_has_tuple
();
if
(
tuple_
==
NULL
)
{
...
...
@@ -4568,16 +4595,16 @@ VarType::mutable_tuple() {
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.tuple)
return
tuple_
;
}
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_Tuple
*
inline
::
paddle_mobile
::
framework
::
proto
::
VarType_Tuple
*
VarType
::
release_tuple
()
{
// @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.tuple)
clear_has_tuple
();
::
paddle_mobile
::
framework
::
proto
::
VarType_Tuple
*
temp
=
tuple_
;
::
paddle_mobile
::
framework
::
proto
::
VarType_Tuple
*
temp
=
tuple_
;
tuple_
=
NULL
;
return
temp
;
}
inline
void
VarType
::
set_allocated_tuple
(
::
paddle_mobile
::
framework
::
proto
::
VarType_Tuple
*
tuple
)
{
::
paddle_mobile
::
framework
::
proto
::
VarType_Tuple
*
tuple
)
{
delete
tuple_
;
tuple_
=
tuple
;
if
(
tuple
)
{
...
...
@@ -4603,50 +4630,50 @@ inline void VarDesc::clear_name() {
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
clear_has_name
();
}
inline
const
::
std
::
string
&
VarDesc
::
name
()
const
{
inline
const
::
std
::
string
&
VarDesc
::
name
()
const
{
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarDesc.name)
return
name_
.
GetNoArena
();
}
inline
void
VarDesc
::
set_name
(
const
::
std
::
string
&
value
)
{
inline
void
VarDesc
::
set_name
(
const
::
std
::
string
&
value
)
{
set_has_name
();
name_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
value
);
// @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarDesc.name)
}
#if LANG_CXX11
inline
void
VarDesc
::
set_name
(
::
std
::
string
&&
value
)
{
inline
void
VarDesc
::
set_name
(
::
std
::
string
&&
value
)
{
set_has_name
();
name_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
::
std
::
move
(
value
));
// @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.VarDesc.name)
}
#endif
inline
void
VarDesc
::
set_name
(
const
char
*
value
)
{
inline
void
VarDesc
::
set_name
(
const
char
*
value
)
{
GOOGLE_DCHECK
(
value
!=
NULL
);
set_has_name
();
name_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
::
std
::
string
(
value
));
// @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.VarDesc.name)
}
inline
void
VarDesc
::
set_name
(
const
char
*
value
,
size_t
size
)
{
inline
void
VarDesc
::
set_name
(
const
char
*
value
,
size_t
size
)
{
set_has_name
();
name_
.
SetNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
(),
::
std
::
string
(
reinterpret_cast
<
const
char
*>
(
value
),
size
));
::
std
::
string
(
reinterpret_cast
<
const
char
*>
(
value
),
size
));
// @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.VarDesc.name)
}
inline
::
std
::
string
*
VarDesc
::
mutable_name
()
{
inline
::
std
::
string
*
VarDesc
::
mutable_name
()
{
set_has_name
();
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarDesc.name)
return
name_
.
MutableNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
}
inline
::
std
::
string
*
VarDesc
::
release_name
()
{
inline
::
std
::
string
*
VarDesc
::
release_name
()
{
// @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarDesc.name)
clear_has_name
();
return
name_
.
ReleaseNoArena
(
&::
google
::
protobuf
::
internal
::
GetEmptyStringAlreadyInited
());
}
inline
void
VarDesc
::
set_allocated_name
(
::
std
::
string
*
name
)
{
inline
void
VarDesc
::
set_allocated_name
(
::
std
::
string
*
name
)
{
if
(
name
!=
NULL
)
{
set_has_name
();
}
else
{
...
...
@@ -4664,19 +4691,20 @@ inline bool VarDesc::has_type() const {
inline
void
VarDesc
::
set_has_type
()
{
_has_bits_
[
0
]
|=
0x00000002u
;
}
inline
void
VarDesc
::
clear_has_type
()
{
_has_bits_
[
0
]
&=
~
0x00000002u
;
}
inline
void
VarDesc
::
clear_type
()
{
if
(
type_
!=
NULL
)
type_
->::
paddle_mobile
::
framework
::
proto
::
VarType
::
Clear
();
if
(
type_
!=
NULL
)
type_
->::
paddle_mobile
::
framework
::
proto
::
VarType
::
Clear
();
clear_has_type
();
}
inline
const
::
paddle_mobile
::
framework
::
proto
::
VarType
&
VarDesc
::
type
()
const
{
const
::
paddle_mobile
::
framework
::
proto
::
VarType
*
p
=
type_
;
inline
const
::
paddle_mobile
::
framework
::
proto
::
VarType
&
VarDesc
::
type
()
const
{
const
::
paddle_mobile
::
framework
::
proto
::
VarType
*
p
=
type_
;
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarDesc.type)
return
p
!=
NULL
?
*
p
:
*
reinterpret_cast
<
const
::
paddle_mobile
::
framework
::
proto
::
VarType
*>
(
const
::
paddle_mobile
::
framework
::
proto
::
VarType
*>
(
&::
paddle_mobile
::
framework
::
proto
::
_VarType_default_instance_
);
}
inline
::
paddle_mobile
::
framework
::
proto
::
VarType
*
VarDesc
::
mutable_type
()
{
inline
::
paddle_mobile
::
framework
::
proto
::
VarType
*
VarDesc
::
mutable_type
()
{
set_has_type
();
if
(
type_
==
NULL
)
{
type_
=
new
::
paddle_mobile
::
framework
::
proto
::
VarType
;
...
...
@@ -4684,15 +4712,15 @@ inline ::paddle_mobile::framework::proto::VarType* VarDesc::mutable_type() {
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarDesc.type)
return
type_
;
}
inline
::
paddle_mobile
::
framework
::
proto
::
VarType
*
VarDesc
::
release_type
()
{
inline
::
paddle_mobile
::
framework
::
proto
::
VarType
*
VarDesc
::
release_type
()
{
// @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarDesc.type)
clear_has_type
();
::
paddle_mobile
::
framework
::
proto
::
VarType
*
temp
=
type_
;
::
paddle_mobile
::
framework
::
proto
::
VarType
*
temp
=
type_
;
type_
=
NULL
;
return
temp
;
}
inline
void
VarDesc
::
set_allocated_type
(
::
paddle_mobile
::
framework
::
proto
::
VarType
*
type
)
{
inline
void
VarDesc
::
set_allocated_type
(
::
paddle_mobile
::
framework
::
proto
::
VarType
*
type
)
{
delete
type_
;
type_
=
type
;
if
(
type
)
{
...
...
@@ -4770,28 +4798,28 @@ inline void BlockDesc::set_parent_idx(::google::protobuf::int32 value) {
// repeated .paddle_mobile.framework.proto.VarDesc vars = 3;
inline
int
BlockDesc
::
vars_size
()
const
{
return
vars_
.
size
();
}
inline
void
BlockDesc
::
clear_vars
()
{
vars_
.
Clear
();
}
inline
const
::
paddle_mobile
::
framework
::
proto
::
VarDesc
&
BlockDesc
::
vars
(
int
index
)
const
{
inline
const
::
paddle_mobile
::
framework
::
proto
::
VarDesc
&
BlockDesc
::
vars
(
int
index
)
const
{
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.BlockDesc.vars)
return
vars_
.
Get
(
index
);
}
inline
::
paddle_mobile
::
framework
::
proto
::
VarDesc
*
BlockDesc
::
mutable_vars
(
int
index
)
{
inline
::
paddle_mobile
::
framework
::
proto
::
VarDesc
*
BlockDesc
::
mutable_vars
(
int
index
)
{
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.BlockDesc.vars)
return
vars_
.
Mutable
(
index
);
}
inline
::
paddle_mobile
::
framework
::
proto
::
VarDesc
*
BlockDesc
::
add_vars
()
{
inline
::
paddle_mobile
::
framework
::
proto
::
VarDesc
*
BlockDesc
::
add_vars
()
{
// @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.BlockDesc.vars)
return
vars_
.
Add
();
}
inline
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
VarDesc
>*
::
paddle_mobile
::
framework
::
proto
::
VarDesc
>
*
BlockDesc
::
mutable_vars
()
{
// @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.BlockDesc.vars)
return
&
vars_
;
}
inline
const
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
VarDesc
>&
::
paddle_mobile
::
framework
::
proto
::
VarDesc
>
&
BlockDesc
::
vars
()
const
{
// @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.BlockDesc.vars)
return
vars_
;
...
...
@@ -4800,28 +4828,28 @@ BlockDesc::vars() const {
// repeated .paddle_mobile.framework.proto.OpDesc ops = 4;
inline
int
BlockDesc
::
ops_size
()
const
{
return
ops_
.
size
();
}
inline
void
BlockDesc
::
clear_ops
()
{
ops_
.
Clear
();
}
inline
const
::
paddle_mobile
::
framework
::
proto
::
OpDesc
&
BlockDesc
::
ops
(
int
index
)
const
{
inline
const
::
paddle_mobile
::
framework
::
proto
::
OpDesc
&
BlockDesc
::
ops
(
int
index
)
const
{
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.BlockDesc.ops)
return
ops_
.
Get
(
index
);
}
inline
::
paddle_mobile
::
framework
::
proto
::
OpDesc
*
BlockDesc
::
mutable_ops
(
int
index
)
{
inline
::
paddle_mobile
::
framework
::
proto
::
OpDesc
*
BlockDesc
::
mutable_ops
(
int
index
)
{
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.BlockDesc.ops)
return
ops_
.
Mutable
(
index
);
}
inline
::
paddle_mobile
::
framework
::
proto
::
OpDesc
*
BlockDesc
::
add_ops
()
{
inline
::
paddle_mobile
::
framework
::
proto
::
OpDesc
*
BlockDesc
::
add_ops
()
{
// @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.BlockDesc.ops)
return
ops_
.
Add
();
}
inline
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
OpDesc
>*
::
paddle_mobile
::
framework
::
proto
::
OpDesc
>
*
BlockDesc
::
mutable_ops
()
{
// @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.BlockDesc.ops)
return
&
ops_
;
}
inline
const
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
OpDesc
>&
::
paddle_mobile
::
framework
::
proto
::
OpDesc
>
&
BlockDesc
::
ops
()
const
{
// @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.BlockDesc.ops)
return
ops_
;
...
...
@@ -4858,28 +4886,28 @@ inline void BlockDesc::set_forward_block_idx(::google::protobuf::int32 value) {
// repeated .paddle_mobile.framework.proto.BlockDesc blocks = 1;
inline
int
ProgramDesc
::
blocks_size
()
const
{
return
blocks_
.
size
();
}
inline
void
ProgramDesc
::
clear_blocks
()
{
blocks_
.
Clear
();
}
inline
const
::
paddle_mobile
::
framework
::
proto
::
BlockDesc
&
ProgramDesc
::
blocks
(
int
index
)
const
{
inline
const
::
paddle_mobile
::
framework
::
proto
::
BlockDesc
&
ProgramDesc
::
blocks
(
int
index
)
const
{
// @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.ProgramDesc.blocks)
return
blocks_
.
Get
(
index
);
}
inline
::
paddle_mobile
::
framework
::
proto
::
BlockDesc
*
inline
::
paddle_mobile
::
framework
::
proto
::
BlockDesc
*
ProgramDesc
::
mutable_blocks
(
int
index
)
{
// @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.ProgramDesc.blocks)
return
blocks_
.
Mutable
(
index
);
}
inline
::
paddle_mobile
::
framework
::
proto
::
BlockDesc
*
ProgramDesc
::
add_blocks
()
{
inline
::
paddle_mobile
::
framework
::
proto
::
BlockDesc
*
ProgramDesc
::
add_blocks
()
{
// @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.ProgramDesc.blocks)
return
blocks_
.
Add
();
}
inline
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
BlockDesc
>*
::
paddle_mobile
::
framework
::
proto
::
BlockDesc
>
*
ProgramDesc
::
mutable_blocks
()
{
// @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.ProgramDesc.blocks)
return
&
blocks_
;
}
inline
const
::
google
::
protobuf
::
RepeatedPtrField
<
::
paddle_mobile
::
framework
::
proto
::
BlockDesc
>&
::
paddle_mobile
::
framework
::
proto
::
BlockDesc
>
&
ProgramDesc
::
blocks
()
const
{
// @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.ProgramDesc.blocks)
return
blocks_
;
...
...
@@ -4887,8 +4915,8 @@ ProgramDesc::blocks() const {
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
// __GNUC__
#endif
// !PROTOBUF_INLINE_NOT_IN_HEADERS
#endif // __GNUC__
#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS
// -------------------------------------------------------------------
// -------------------------------------------------------------------
...
...
@@ -4921,9 +4949,9 @@ ProgramDesc::blocks() const {
// @@protoc_insertion_point(namespace_scope)
}
// namespace proto
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace proto
}
// namespace framework
}
// namespace paddle_mobile
namespace
google
{
namespace
protobuf
{
...
...
@@ -4935,9 +4963,9 @@ template <>
struct
is_proto_enum
<::
paddle_mobile
::
framework
::
proto
::
AttrType
>
:
::
google
::
protobuf
::
internal
::
true_type
{};
}
// namespace protobuf
}
// namespace google
}
// namespace protobuf
}
// namespace google
// @@protoc_insertion_point(global_scope)
#endif
// PROTOBUF_framework_2eproto__INCLUDED
#endif // PROTOBUF_framework_2eproto__INCLUDED
src/framework/lod_tensor.cc
浏览文件 @
d2f8befa
...
...
@@ -13,10 +13,10 @@ See the License for the specific language governing permissions and
limitations under the License. */
#include "lod_tensor.h"
#include <stdint.h>
#include <string.h>
#include <algorithm>
#include <iterator>
#include <stdint.h>
#include <string.h>
namespace
paddle_mobile
{
namespace
framework
{
...
...
@@ -103,7 +103,8 @@ LoD SliceInLevel(const LoD &in, size_t level, size_t elem_begin,
LoD
ToAbsOffset
(
const
LoD
&
in
)
{
// the lowest level stores relative offsets
if
(
in
.
empty
()
||
in
.
size
()
==
1
)
return
in
;
if
(
in
.
empty
()
||
in
.
size
()
==
1
)
return
in
;
LoD
result
=
in
;
for
(
auto
level
=
static_cast
<
int
>
(
in
.
size
()
-
2
);
level
>=
0
;
level
--
)
{
for
(
size_t
i
=
0
;
i
<
in
[
level
].
size
();
++
i
)
{
...
...
@@ -135,16 +136,20 @@ bool operator==(const LoD &a, const LoD &b) {
}
bool
CheckLoD
(
const
LoD
&
in
,
int
tensor_height
)
{
if
(
in
.
empty
())
return
true
;
if
(
in
.
empty
())
return
true
;
for
(
const
auto
&
level
:
in
)
{
// check: there should be more than 2 offsets existing in each level.
if
(
level
.
size
()
<
2
)
return
false
;
if
(
level
.
size
()
<
2
)
return
false
;
// check: the first offset(the begin offset) of each level should be 0.
if
(
level
.
front
()
!=
0
)
return
false
;
if
(
level
.
front
()
!=
0
)
return
false
;
// check: all the offsets in a level should be ascending(no same items
// allows).
if
(
!
std
::
is_sorted
(
level
.
begin
(),
level
.
begin
(),
[](
size_t
a
,
size_t
b
)
{
if
(
a
<
b
)
return
true
;
if
(
a
<
b
)
return
true
;
return
false
;
}))
{
std
::
cout
<<
"ascending error"
;
...
...
@@ -161,29 +166,34 @@ bool CheckLoD(const LoD &in, int tensor_height) {
// NOTE LoD store the levels from top to bottom, so the higher level goes
// first.
for
(
size_t
level
=
0
;
level
<
in
.
size
()
-
1
;
level
++
)
{
if
(
in
[
level
].
back
()
!=
in
[
level
+
1
].
size
()
-
1
)
return
false
;
if
(
in
[
level
].
back
()
!=
in
[
level
+
1
].
size
()
-
1
)
return
false
;
}
return
true
;
}
bool
CheckAbsLoD
(
const
LoD
&
in
,
int
tensor_height
)
{
if
(
in
.
empty
())
return
true
;
if
(
in
.
empty
())
return
true
;
for
(
const
auto
&
level
:
in
)
{
// check: all the offsets in a level should be ascending(no same items
// allows).
if
(
!
std
::
is_sorted
(
level
.
begin
(),
level
.
begin
(),
[](
size_t
a
,
size_t
b
)
{
if
(
a
<
b
)
return
true
;
if
(
a
<
b
)
return
true
;
return
false
;
}))
{
return
false
;
}
// check: there should be more than 2 offsets existing in each level.
if
(
level
.
size
()
<
2
)
return
false
;
if
(
level
.
size
()
<
2
)
return
false
;
// check: the first offset of each level should be 0, and the last should be
// the same(the height of underlying tensor).
if
(
level
.
front
()
!=
0
)
return
false
;
if
(
level
.
front
()
!=
0
)
return
false
;
if
(
tensor_height
<
0
)
{
tensor_height
=
level
.
back
();
}
else
if
((
size_t
)
tensor_height
!=
level
.
back
())
{
...
...
@@ -220,7 +230,7 @@ void AppendLoD(LoD *lod, const LoD &lod_length) {
// "The lod_length should has the same size with the appended lod.");
if
(
lod
->
empty
())
{
for
(
size_t
i
=
0
;
i
<
lod_length
.
size
();
++
i
)
{
lod
->
emplace_back
(
1
,
0
);
// size = 1, value = 0;
lod
->
emplace_back
(
1
,
0
);
// size = 1, value = 0;
}
*
lod
=
LoD
(
lod_length
.
size
(),
std
::
vector
<
size_t
>
({
0
}));
}
...
...
@@ -233,7 +243,7 @@ void AppendLoD(LoD *lod, const LoD &lod_length) {
}
void
SerializeToStream
(
std
::
ostream
&
os
,
const
LoDTensor
&
tensor
)
{
{
// the 1st field, uint32_t version for LoDTensor
{
// the 1st field, uint32_t version for LoDTensor
constexpr
uint32_t
version
=
0
;
os
.
write
(
reinterpret_cast
<
const
char
*>
(
&
version
),
sizeof
(
version
));
}
...
...
@@ -284,5 +294,5 @@ void DeserializeFromStream(std::istream &is, LoDTensor *tensor) {
TensorFromStream
(
is
,
static_cast
<
Tensor
*>
(
tensor
));
}
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/framework/lod_tensor.h
浏览文件 @
d2f8befa
...
...
@@ -14,12 +14,12 @@ limitations under the License. */
#pragma once
#include "tensor.h"
#include "tensor_util.h"
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "tensor.h"
#include "tensor_util.h"
namespace
paddle_mobile
{
...
...
@@ -96,7 +96,7 @@ bool CheckAbsLoD(const LoD &in, int tensor_height = -1);
* see https://en.wikipedia.org/wiki/Level_of_details for reference.
*/
class
LoDTensor
:
public
Tensor
{
public:
public:
LoDTensor
()
:
Tensor
()
{}
explicit
LoDTensor
(
const
LoD
&
lod
)
:
lod_
(
lod
)
{}
...
...
@@ -131,7 +131,7 @@ class LoDTensor : public Tensor {
return
(
lod_
)[
level
].
size
()
-
1
;
}
private:
private:
LoD
lod_
;
};
...
...
@@ -181,8 +181,9 @@ LoDTensor LodExpand(const LoDTensor &source, const LoD &lod, size_t level) {
// Returns:
// LoD = [[1, 4], [2, 4, 2, 3, 2]]
// pair<size_t, size_t> = {11, 24}
std
::
pair
<
LoD
,
std
::
pair
<
size_t
,
size_t
>>
GetSubLoDAndAbsoluteOffset
(
const
LoD
&
lod
,
size_t
start_idx
,
size_t
end_idx
,
size_t
start_level
);
std
::
pair
<
LoD
,
std
::
pair
<
size_t
,
size_t
>>
GetSubLoDAndAbsoluteOffset
(
const
LoD
&
lod
,
size_t
start_idx
,
size_t
end_idx
,
size_t
start_level
);
void
AppendLoD
(
LoD
*
lod
,
const
LoD
&
lod_length
);
...
...
@@ -195,5 +196,5 @@ void SerializeToStream(std::ostream &os, const LoDTensor &tensor);
void
DeserializeFromStream
(
std
::
istream
&
is
,
LoDTensor
*
tensor
);
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/framework/op_desc.cpp
浏览文件 @
d2f8befa
...
...
@@ -55,5 +55,5 @@ const std::unordered_map<std::string, Attribute> &OpDesc::GetAttrMap() const {
return
attrs_
;
}
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/framework/op_desc.h
浏览文件 @
d2f8befa
...
...
@@ -26,7 +26,7 @@ namespace paddle_mobile {
namespace
framework
{
class
OpDesc
:
PaddleMobileObject
{
public:
public:
OpDesc
(
const
proto
::
OpDesc
&
desc
);
const
std
::
vector
<
std
::
string
>
&
Input
(
const
std
::
string
&
name
)
const
;
const
std
::
vector
<
std
::
string
>
&
Output
(
const
std
::
string
&
name
)
const
;
...
...
@@ -40,12 +40,12 @@ class OpDesc : PaddleMobileObject {
const
std
::
string
&
Type
()
{
return
desc_
.
type
();
};
private:
private:
proto
::
OpDesc
desc_
;
VariableNameMap
inputs_
;
VariableNameMap
outputs_
;
AttributeMap
attrs_
;
};
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/framework/op_info.h
浏览文件 @
d2f8befa
...
...
@@ -24,42 +24,38 @@ SOFTWARE.
namespace
paddle_mobile
{
namespace
framework
{
template
<
typename
Dtype
>
struct
OpInfo
{
template
<
typename
Dtype
>
struct
OpInfo
{
OpCreator
<
Dtype
>
creator_
;
const
OpCreator
<
Dtype
>
&
Creator
()
const
{
const
OpCreator
<
Dtype
>
&
Creator
()
const
{
// PADDLE_ENFORCE_NOT_NULL(creator_,
// "Operator Creator has not been registered");
return
creator_
;
}
};
template
<
typename
Dtype
>
class
OpInfoMap
;
template
<
typename
Dtype
>
class
OpInfoMap
;
template
<
typename
Dtype
>
static
OpInfoMap
<
Dtype
>*
g_op_info_map
=
nullptr
;
template
<
typename
Dtype
>
static
OpInfoMap
<
Dtype
>
*
g_op_info_map
=
nullptr
;
template
<
typename
Dtype
>
class
OpInfoMap
{
public:
static
OpInfoMap
&
Instance
()
{
template
<
typename
Dtype
>
class
OpInfoMap
{
public:
static
OpInfoMap
&
Instance
()
{
if
(
g_op_info_map
<
Dtype
>
==
nullptr
)
{
g_op_info_map
<
Dtype
>
=
new
OpInfoMap
();
}
return
*
g_op_info_map
<
Dtype
>
;
};
bool
Has
(
const
std
::
string
&
op_type
)
const
{
bool
Has
(
const
std
::
string
&
op_type
)
const
{
return
map_
.
find
(
op_type
)
!=
map_
.
end
();
}
void
Insert
(
const
std
::
string
&
type
,
const
OpInfo
<
Dtype
>&
info
)
{
void
Insert
(
const
std
::
string
&
type
,
const
OpInfo
<
Dtype
>
&
info
)
{
// PADDLE_ENFORCE(!Has(type), "Operator %s has been registered", type);
map_
.
insert
({
type
,
info
});
}
const
OpInfo
<
Dtype
>
&
Get
(
const
std
::
string
&
type
)
const
{
const
OpInfo
<
Dtype
>
&
Get
(
const
std
::
string
&
type
)
const
{
auto
op_info_ptr
=
GetNullable
(
type
);
// PADDLE_ENFORCE_NOT_NULL(op_info_ptr, "Operator %s has not been
// registered",
...
...
@@ -67,7 +63,7 @@ class OpInfoMap {
return
*
op_info_ptr
;
}
const
OpInfo
<
Dtype
>
*
GetNullable
(
const
std
::
string
&
type
)
const
{
const
OpInfo
<
Dtype
>
*
GetNullable
(
const
std
::
string
&
type
)
const
{
auto
it
=
map_
.
find
(
type
);
if
(
it
==
map_
.
end
())
{
return
nullptr
;
...
...
@@ -76,20 +72,20 @@ class OpInfoMap {
}
}
const
std
::
unordered_map
<
std
::
string
,
OpInfo
<
Dtype
>>
&
map
()
const
{
const
std
::
unordered_map
<
std
::
string
,
OpInfo
<
Dtype
>>
&
map
()
const
{
return
map_
;
}
std
::
unordered_map
<
std
::
string
,
OpInfo
<
Dtype
>>
*
mutable_map
()
{
std
::
unordered_map
<
std
::
string
,
OpInfo
<
Dtype
>>
*
mutable_map
()
{
return
&
map_
;
}
private:
private:
OpInfoMap
()
=
default
;
std
::
unordered_map
<
std
::
string
,
OpInfo
<
Dtype
>>
map_
;
// DISABLE_COPY_AND_ASSIGN(OpInfoMap);
};
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/framework/op_kernel_type.h
浏览文件 @
d2f8befa
...
...
@@ -25,7 +25,7 @@ namespace paddle_mobile {
namespace
framework
{
struct
OpKernelType
{
struct
Hash
{
size_t
operator
()(
const
OpKernelType
&
key
)
const
{
size_t
operator
()(
const
OpKernelType
&
key
)
const
{
int
data_type
=
static_cast
<
int
>
(
key
.
data_type_
)
<<
LEFT_SHIFT
;
int
data_layout
=
static_cast
<
int
>
(
key
.
data_layout_
)
<<
(
LEFT_SHIFT
*
2
);
...
...
@@ -44,21 +44,21 @@ struct OpKernelType {
DataLayout
data_layout
=
DataLayout
::
kAnyLayout
)
:
data_type_
(
data_type
),
data_layout_
(
data_layout
)
{}
bool
operator
==
(
const
OpKernelType
&
o
)
const
{
bool
operator
==
(
const
OpKernelType
&
o
)
const
{
return
data_type_
==
o
.
data_type_
&&
data_layout_
==
o
.
data_layout_
;
}
bool
operator
!=
(
const
OpKernelType
&
o
)
const
{
return
!
(
*
this
==
o
);
}
bool
operator
!=
(
const
OpKernelType
&
o
)
const
{
return
!
(
*
this
==
o
);
}
};
inline
bool
NeedTransformLayout
(
const
DataLayout
&
l
,
const
DataLayout
&
r
)
{
inline
bool
NeedTransformLayout
(
const
DataLayout
&
l
,
const
DataLayout
&
r
)
{
return
l
!=
DataLayout
::
kAnyLayout
&&
r
!=
DataLayout
::
kAnyLayout
&&
l
!=
r
;
}
inline
bool
TransFromNeeded
(
const
OpKernelType
&
l
,
const
OpKernelType
&
r
)
{
inline
bool
TransFromNeeded
(
const
OpKernelType
&
l
,
const
OpKernelType
&
r
)
{
return
(
l
.
data_type_
!=
r
.
data_type_
)
||
NeedTransformLayout
(
l
.
data_layout_
,
r
.
data_layout_
);
}
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/framework/op_proto_maker.h
浏览文件 @
d2f8befa
...
...
@@ -22,5 +22,5 @@ namespace paddle_mobile {
namespace
framework
{
// this class not only make proto but also init attribute checkers.
class
OpProtoAndCheckerMaker
{};
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/framework/operator.cpp
浏览文件 @
d2f8befa
...
...
@@ -23,23 +23,17 @@ namespace paddle_mobile {
namespace
framework
{
template
<
typename
Dtype
>
OperatorBase
<
Dtype
>::
OperatorBase
(
const
std
::
string
&
type
,
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
AttributeMap
&
attrs
,
OperatorBase
<
Dtype
>::
OperatorBase
(
const
std
::
string
&
type
,
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
AttributeMap
&
attrs
,
std
::
shared_ptr
<
Scope
>
scope
)
:
type_
(
type
),
inputs_
(
inputs
),
outputs_
(
outputs
),
attrs_
(
attrs
),
:
type_
(
type
),
inputs_
(
inputs
),
outputs_
(
outputs
),
attrs_
(
attrs
),
scope_
(
scope
)
{
CheckAllInputOutputSet
();
}
template
<
typename
Dtype
>
void
OperatorBase
<
Dtype
>::
Run
()
{
RunImpl
();
}
template
<
typename
Dtype
>
void
OperatorBase
<
Dtype
>::
Run
()
{
RunImpl
();
}
template
<
typename
Dtype
>
void
OperatorBase
<
Dtype
>::
CheckAllInputOutputSet
()
const
{}
...
...
@@ -47,5 +41,5 @@ void OperatorBase<Dtype>::CheckAllInputOutputSet() const {}
template
class
OperatorBase
<
CPU
>;
template
class
OperatorWithKernel
<
CPU
>;
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/framework/operator.h
浏览文件 @
d2f8befa
...
...
@@ -35,53 +35,51 @@ SOFTWARE.
namespace
paddle_mobile
{
namespace
framework
{
template
<
typename
Dtype
>
class
OperatorBase
:
PaddleMobileObject
{
public:
OperatorBase
(
const
std
::
string
&
type
,
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
AttributeMap
&
attrs
,
template
<
typename
Dtype
>
class
OperatorBase
:
PaddleMobileObject
{
public:
OperatorBase
(
const
std
::
string
&
type
,
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
AttributeMap
&
attrs
,
std
::
shared_ptr
<
Scope
>
scope
);
virtual
~
OperatorBase
()
{}
virtual
void
Run
();
const
VariableNameMap
&
Inputs
()
const
{
return
inputs_
;
}
const
VariableNameMap
&
Outputs
()
const
{
return
outputs_
;
}
const
std
::
string
&
Type
()
const
{
return
type_
;
}
const
AttributeMap
&
Attrs
()
const
{
return
attrs_
;
}
const
VariableNameMap
&
Inputs
()
const
{
return
inputs_
;
}
const
VariableNameMap
&
Outputs
()
const
{
return
outputs_
;
}
const
std
::
string
&
Type
()
const
{
return
type_
;
}
const
AttributeMap
&
Attrs
()
const
{
return
attrs_
;
}
protected:
protected:
std
::
shared_ptr
<
Scope
>
scope_
;
std
::
string
type_
;
VariableNameMap
inputs_
;
VariableNameMap
outputs_
;
AttributeMap
attrs_
;
private:
private:
void
CheckAllInputOutputSet
()
const
;
virtual
void
RunImpl
()
const
=
0
;
};
template
<
typename
Dtype
>
class
OperatorWithKernel
:
public
OperatorBase
<
Dtype
>
{
public:
OperatorWithKernel
(
const
std
::
string
&
type
,
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
AttributeMap
&
attrs
,
public:
OperatorWithKernel
(
const
std
::
string
&
type
,
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
AttributeMap
&
attrs
,
std
::
shared_ptr
<
Scope
>
scope
)
:
OperatorBase
<
Dtype
>
(
type
,
inputs
,
outputs
,
attrs
,
scope
)
{}
virtual
void
InferShape
()
const
=
0
;
protected:
protected:
virtual
void
RunImpl
()
const
=
0
;
private:
private:
};
template
<
typename
Dtype
,
typename
P
>
class
OpKernelBase
:
PaddleMobileObject
{
public:
virtual
void
Compute
(
const
P
&
para
)
const
=
0
;
template
<
typename
Dtype
,
typename
P
>
class
OpKernelBase
:
PaddleMobileObject
{
public:
virtual
void
Compute
(
const
P
&
para
)
const
=
0
;
virtual
~
OpKernelBase
()
=
default
;
};
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/framework/paddle_mobile_object.h
浏览文件 @
d2f8befa
...
...
@@ -18,19 +18,19 @@ SOFTWARE.
#pragma once
#include <string>
#include "stdio.h"
#include <string>
namespace
paddle_mobile
{
class
PaddleMobileObject
{
public:
virtual
inline
const
std
::
string
&
ToString
()
{
public:
virtual
inline
const
std
::
string
&
ToString
()
{
char
address
[
128
]
=
{
0
};
sprintf
(
address
,
"%p"
,
this
);
return
std
::
string
(
address
);
}
private:
private:
};
}
// namespace paddle_mobile
}
// namespace paddle_mobile
src/framework/program.cpp
浏览文件 @
d2f8befa
...
...
@@ -18,4 +18,4 @@ SOFTWARE.
namespace
paddle_mobile
{
namespace
framework
{}
}
// namespace paddle_mobile
}
// namespace paddle_mobile
src/framework/program.h
浏览文件 @
d2f8befa
...
...
@@ -28,13 +28,13 @@ namespace framework {
template
<
typename
Dtype
,
Precision
P
=
Precision
::
FP32
>
class
Program
:
PaddleMobileObject
{
public:
public:
std
::
shared_ptr
<
ProgramDesc
>
originProgram
;
std
::
shared_ptr
<
ProgramDesc
>
optimizeProgram
;
std
::
shared_ptr
<
Scope
>
scope
;
private:
private:
};
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/framework/program_desc.cpp
浏览文件 @
d2f8befa
...
...
@@ -18,5 +18,5 @@ std::shared_ptr<BlockDesc> ProgramDesc::Block(size_t idx) {
return
blocks_
[
idx
];
}
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/framework/program_desc.h
浏览文件 @
d2f8befa
...
...
@@ -28,15 +28,15 @@ namespace paddle_mobile {
namespace
framework
{
class
ProgramDesc
:
PaddleMobileObject
{
public:
public:
ProgramDesc
(
const
proto
::
ProgramDesc
&
desc
);
std
::
shared_ptr
<
BlockDesc
>
Block
(
size_t
idx
);
const
std
::
vector
<
std
::
shared_ptr
<
BlockDesc
>>
&
Blocks
()
{
return
blocks_
;
};
private:
private:
std
::
vector
<
std
::
shared_ptr
<
BlockDesc
>>
blocks_
;
proto
::
ProgramDesc
desc_
;
};
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/framework/scope.cc
浏览文件 @
d2f8befa
...
...
@@ -112,5 +112,5 @@ Variable *Scope::FindVarLocally(const std::string &name) const {
return
nullptr
;
}
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/framework/scope.h
浏览文件 @
d2f8befa
...
...
@@ -18,38 +18,38 @@ SOFTWARE.
==============================================================================*/
#pragma once
#include <list> //std::list
#include <mutex> //std::mutex
#include <unordered_map> //std::unordered_map
#include "variable.h"
#include <list> //std::list
#include <mutex> //std::mutex
#include <unordered_map> //std::unordered_map
namespace
paddle_mobile
{
namespace
framework
{
class
Scope
{
public:
public:
Scope
()
{}
~
Scope
()
{}
Scope
&
NewScope
()
const
;
Scope
&
NewScope
()
const
;
/// Create a variable with given name if it doesn't exist.
Variable
*
Var
(
const
std
::
string
&
name
);
Variable
*
Var
(
const
std
::
string
&
name
);
/// Create a variable with a scope-unique name.
Variable
*
Var
(
std
::
string
*
name
=
nullptr
);
Variable
*
Var
(
std
::
string
*
name
=
nullptr
);
void
EraseVars
(
const
std
::
vector
<
std
::
string
>
&
var_names
);
void
EraseVars
(
const
std
::
vector
<
std
::
string
>
&
var_names
);
/// Find a variable in the scope or any of its ancestors. Returns
/// nullptr if cannot find.
Variable
*
FindVar
(
const
std
::
string
&
name
)
const
;
Variable
*
FindVar
(
const
std
::
string
&
name
)
const
;
const
Scope
*
parent
()
const
{
return
parent_
;
}
const
Scope
*
parent
()
const
{
return
parent_
;
}
/// Find the scope or an ancestor scope that contains the given variable.
const
Scope
*
FindScope
(
const
Variable
*
var
)
const
;
const
Scope
*
FindScope
(
const
Variable
*
var
)
const
;
void
DeleteScope
(
Scope
*
scope
)
const
;
void
DeleteScope
(
Scope
*
scope
)
const
;
/// Drop all kids scopes belonged to this scope.
void
DropKids
();
...
...
@@ -58,23 +58,23 @@ class Scope {
std
::
vector
<
std
::
string
>
LocalVarNames
()
const
;
// Rename variable to a new name
void
Rename
(
const
std
::
string
&
origin_name
,
const
std
::
string
&
new_name
)
const
;
void
Rename
(
const
std
::
string
&
origin_name
,
const
std
::
string
&
new_name
)
const
;
// Rename variable to a new name and return the new name
std
::
string
Rename
(
const
std
::
string
&
origin_name
)
const
;
std
::
string
Rename
(
const
std
::
string
&
origin_name
)
const
;
Variable
*
FindVarLocally
(
const
std
::
string
&
name
)
const
;
Variable
*
FindVarLocally
(
const
std
::
string
&
name
)
const
;
private:
private:
// Call Scope::NewScope for a sub-scope.
explicit
Scope
(
Scope
const
*
parent
)
:
parent_
(
parent
)
{}
explicit
Scope
(
Scope
const
*
parent
)
:
parent_
(
parent
)
{}
mutable
std
::
unordered_map
<
std
::
string
,
Variable
*>
vars_
;
mutable
std
::
list
<
Scope
*>
kids_
;
Scope
const
*
parent_
{
nullptr
};
mutable
std
::
unordered_map
<
std
::
string
,
Variable
*>
vars_
;
mutable
std
::
list
<
Scope
*>
kids_
;
Scope
const
*
parent_
{
nullptr
};
mutable
std
::
mutex
mutex_
;
};
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/framework/selected_rows.h
浏览文件 @
d2f8befa
...
...
@@ -27,8 +27,8 @@ namespace paddle_mobile {
namespace
framework
{
class
SelectedRows
{
public:
SelectedRows
(
const
std
::
vector
<
int64_t
>
&
rows
,
const
int64_t
&
height
)
public:
SelectedRows
(
const
std
::
vector
<
int64_t
>
&
rows
,
const
int64_t
&
height
)
:
rows_
(
rows
),
height_
(
height
)
{
value_
.
reset
(
new
Tensor
());
}
...
...
@@ -38,19 +38,19 @@ class SelectedRows {
value_
.
reset
(
new
Tensor
());
}
const
Tensor
&
value
()
const
{
return
*
value_
;
}
const
Tensor
&
value
()
const
{
return
*
value_
;
}
Tensor
*
mutable_value
()
{
return
value_
.
get
();
}
Tensor
*
mutable_value
()
{
return
value_
.
get
();
}
int64_t
height
()
const
{
return
height_
;
}
void
set_height
(
int64_t
height
)
{
height_
=
height
;
}
const
std
::
vector
<
int64_t
>
&
rows
()
const
{
return
rows_
;
}
const
std
::
vector
<
int64_t
>
&
rows
()
const
{
return
rows_
;
}
std
::
vector
<
int64_t
>
*
mutable_rows
()
{
return
&
rows_
;
}
std
::
vector
<
int64_t
>
*
mutable_rows
()
{
return
&
rows_
;
}
void
set_rows
(
const
std
::
vector
<
int64_t
>
&
rows
)
{
rows_
=
rows
;
}
void
set_rows
(
const
std
::
vector
<
int64_t
>
&
rows
)
{
rows_
=
rows
;
}
/**
* get the index of id in rows
...
...
@@ -67,7 +67,7 @@ class SelectedRows {
return
make_ddim
(
dims
);
}
private:
private:
// Notice: rows can be duplicate. We can have {0, 4, 7, 0, 5, 7, 9} here.
// SelectedRows are simply concated when adding together. Until a
// SelectedRows add a Tensor, will the duplicate rows be handled.
...
...
@@ -76,5 +76,5 @@ class SelectedRows {
int64_t
height_
;
};
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/framework/tensor.h
浏览文件 @
d2f8befa
...
...
@@ -26,11 +26,9 @@ limitations under the License. */
namespace
paddle_mobile
{
namespace
framework
{
template
<
typename
...
T
>
struct
SizeOfTypeFunctor
;
template
<
typename
...
T
>
struct
SizeOfTypeFunctor
;
template
<
typename
T
>
struct
SizeOfTypeFunctor
<
T
>
{
template
<
typename
T
>
struct
SizeOfTypeFunctor
<
T
>
{
size_t
operator
()(
std
::
type_index
type
)
const
{
if
(
typeid
(
T
).
hash_code
()
==
type
.
hash_code
())
{
return
sizeof
(
T
);
...
...
@@ -40,8 +38,7 @@ struct SizeOfTypeFunctor<T> {
}
};
template
<
>
struct
SizeOfTypeFunctor
<>
{
template
<
>
struct
SizeOfTypeFunctor
<>
{
size_t
operator
()(
std
::
type_index
type
)
const
{
return
0UL
;
}
};
...
...
@@ -68,12 +65,11 @@ static inline size_t SizeOfType(std::type_index type) {
class
LoDTensor
;
class
Tensor
{
public:
public:
Tensor
()
:
offset_
(
0
)
{}
/*! Return a pointer to mutable memory block. */
template
<
typename
T
>
inline
T
*
data
()
{
template
<
typename
T
>
inline
T
*
data
()
{
check_memory_size
();
// PADDLE_ENFORCE(std::is_same<T, void>::value ||
// holder_->type().hash_code() == typeid(T).hash_code(),
...
...
@@ -84,8 +80,7 @@ class Tensor {
}
/*! Return a pointer to constant memory block. */
template
<
typename
T
>
inline
const
T
*
data
()
const
{
template
<
typename
T
>
inline
const
T
*
data
()
const
{
check_memory_size
();
// PADDLE_ENFORCE(std::is_same<T, void>::value ||
// holder_->type().hash_code() == typeid(T).hash_code(),
...
...
@@ -102,8 +97,7 @@ class Tensor {
* @brief Return a pointer to mutable memory block.
* @note If not exist, then allocation.
*/
template
<
typename
T
>
inline
T
*
mutable_data
()
{
template
<
typename
T
>
inline
T
*
mutable_data
()
{
static_assert
(
std
::
is_pod
<
T
>::
value
,
"T must be POD"
);
return
reinterpret_cast
<
T
*>
(
mutable_data
(
typeid
(
T
)));
}
...
...
@@ -141,8 +135,7 @@ class Tensor {
*
* @note If not exist, then allocation.
*/
template
<
typename
T
>
inline
T
*
mutable_data
(
DDim
dims
)
{
template
<
typename
T
>
inline
T
*
mutable_data
(
DDim
dims
)
{
static_assert
(
std
::
is_pod
<
T
>::
value
,
"T must be POD"
);
Resize
(
dims
);
return
mutable_data
<
T
>
();
...
...
@@ -227,7 +220,7 @@ class Tensor {
inline
void
set_layout
(
const
DataLayout
layout
)
{
layout_
=
layout
;
}
private:
private:
/**
* @note Placeholder hides type T, so it doesn't appear as a template
* parameter of Variable.
...
...
@@ -248,8 +241,7 @@ class Tensor {
PlaceholderImpl
(
size_t
size
,
std
::
type_index
type
)
:
ptr_
(
static_cast
<
uint8_t
*>
(
memory
::
Alloc
(
size
)),
memory
::
PODDeleter
<
uint8_t
>
()),
size_
(
size
),
type_
(
type
)
{
size_
(
size
),
type_
(
type
)
{
// PADDLE_ENFORCE_NOT_NULL(ptr_, "Insufficient %s
// memory to allocation.",
// (is_cpu_place(place_) ?
...
...
@@ -315,5 +307,5 @@ inline Tensor ReshapeToMatrix(const Tensor &src, int num_col_dims) {
return
res
;
}
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/framework/tensor_util.cc
浏览文件 @
d2f8befa
...
...
@@ -20,7 +20,7 @@
namespace
paddle_mobile
{
namespace
framework
{
void
TensorCopy
(
const
Tensor
&
src
,
Tensor
*
dst
)
{
void
TensorCopy
(
const
Tensor
&
src
,
Tensor
*
dst
)
{
// VLOG(3) << "TensorCopy " << src.dims() << " from " << src.place() << " to
// "
// << dst_place;
...
...
@@ -37,7 +37,7 @@ void TensorCopy(const Tensor& src, Tensor* dst) {
memory
::
Copy
(
dst_ptr
,
src_ptr
,
size
);
}
void
TensorCopySync
(
const
Tensor
&
src
,
Tensor
*
dst
)
{
void
TensorCopySync
(
const
Tensor
&
src
,
Tensor
*
dst
)
{
// VLOG(3) << "TensorCopySync " << src.dims() << " from " << src.place()
// << " to " << dst_place;
src
.
check_memory_size
();
...
...
@@ -49,17 +49,15 @@ void TensorCopySync(const Tensor& src, Tensor* dst) {
memory
::
Copy
(
dst_ptr
,
src_ptr
,
size
);
}
template
<
typename
Predicate
>
struct
AnyDTypeVisitor
{
template
<
typename
Predicate
>
struct
AnyDTypeVisitor
{
Predicate
predicate_
;
const
Tensor
&
tensor_
;
Tensor
*
out_
;
const
Tensor
&
tensor_
;
Tensor
*
out_
;
AnyDTypeVisitor
(
Predicate
predicate
,
const
Tensor
&
tensor
,
Tensor
*
out
)
AnyDTypeVisitor
(
Predicate
predicate
,
const
Tensor
&
tensor
,
Tensor
*
out
)
:
predicate_
(
predicate
),
tensor_
(
tensor
),
out_
(
out
)
{}
template
<
typename
T
>
void
operator
()()
const
{
template
<
typename
T
>
void
operator
()()
const
{
// auto t = EigenVector<T>::Flatten(tensor_);
// auto o = EigenScalar<bool>::From(*out_);
// return any of predicate_(t) is true.
...
...
@@ -68,18 +66,17 @@ struct AnyDTypeVisitor {
};
template
<
typename
Predicate
>
inline
void
AnyImpl
(
Predicate
predicate
,
const
Tensor
&
tensor
,
framework
::
Tensor
*
out
)
{
inline
void
AnyImpl
(
Predicate
predicate
,
const
Tensor
&
tensor
,
framework
::
Tensor
*
out
)
{
VisitDataType
(
ToDataType
(
tensor
.
type
()),
AnyDTypeVisitor
<
Predicate
>
(
predicate
,
tensor
,
out
));
}
template
<
typename
Predicate
>
struct
AnyVisitor
{
const
framework
::
Tensor
&
tensor_
;
template
<
typename
Predicate
>
struct
AnyVisitor
{
const
framework
::
Tensor
&
tensor_
;
Predicate
predicate_
;
AnyVisitor
(
const
framework
::
Tensor
&
tensor
,
Predicate
predicate
)
AnyVisitor
(
const
framework
::
Tensor
&
tensor
,
Predicate
predicate
)
:
tensor_
(
tensor
),
predicate_
(
std
::
move
(
predicate
))
{}
bool
operator
()(
void
)
const
{
...
...
@@ -90,13 +87,13 @@ struct AnyVisitor {
return
this
->
GetResult
(
out
);
}
bool
GetResult
(
const
framework
::
Tensor
&
out
)
const
{
bool
GetResult
(
const
framework
::
Tensor
&
out
)
const
{
return
*
out
.
data
<
bool
>
();
}
};
template
<
typename
Predicate
>
inline
bool
Any
(
const
framework
::
Tensor
&
tensor
,
Predicate
predicate
)
{
inline
bool
Any
(
const
framework
::
Tensor
&
tensor
,
Predicate
predicate
)
{
AnyVisitor
<
Predicate
>
visitor
(
tensor
,
predicate
);
// return platform::VisitPlace(visitor);
return
visitor
();
...
...
@@ -104,101 +101,100 @@ inline bool Any(const framework::Tensor& tensor, Predicate predicate) {
struct
ContainsNANPredicate
{
template
<
typename
T
>
auto
operator
()(
const
T
&
eigen_vec
)
const
auto
operator
()(
const
T
&
eigen_vec
)
const
->
decltype
(
std
::
declval
<
T
>
().
isnan
())
{
// Cast eigen_vector to vector of bool. true if is inf.
return
eigen_vec
.
isnan
();
}
};
bool
TensorContainsNAN
(
const
framework
::
Tensor
&
tensor
)
{
bool
TensorContainsNAN
(
const
framework
::
Tensor
&
tensor
)
{
ContainsNANPredicate
predicate
;
return
Any
(
tensor
,
predicate
);
}
struct
ContainsInfPredicate
{
template
<
typename
T
>
auto
operator
()(
const
T
&
eigen_vec
)
const
auto
operator
()(
const
T
&
eigen_vec
)
const
->
decltype
(
std
::
declval
<
T
>
().
isinf
())
{
// Cast eigen_vector to vector of bool. true if is inf.
return
eigen_vec
.
isinf
();
}
};
bool
TensorContainsInf
(
const
framework
::
Tensor
&
tensor
)
{
bool
TensorContainsInf
(
const
framework
::
Tensor
&
tensor
)
{
ContainsInfPredicate
predicate
;
return
Any
(
tensor
,
predicate
);
}
void
TensorToStream
(
std
::
ostream
&
os
,
const
Tensor
&
tensor
)
{
{
// the 1st field, uint32_t version
void
TensorToStream
(
std
::
ostream
&
os
,
const
Tensor
&
tensor
)
{
{
// the 1st field, uint32_t version
constexpr
uint32_t
version
=
0
;
os
.
write
(
reinterpret_cast
<
const
char
*>
(
&
version
),
sizeof
(
version
));
os
.
write
(
reinterpret_cast
<
const
char
*>
(
&
version
),
sizeof
(
version
));
}
{
// the 2nd field, tensor description
// int32_t size
// void* protobuf message
{
// the 2nd field, tensor description
// int32_t size
// void* protobuf message
proto
::
VarType
::
TensorDesc
desc
;
desc
.
set_data_type
(
framework
::
ToDataType
(
tensor
.
type
()));
auto
dims
=
framework
::
vectorize
(
tensor
.
dims
());
auto
*
pb_dims
=
desc
.
mutable_dims
();
auto
*
pb_dims
=
desc
.
mutable_dims
();
pb_dims
->
Resize
(
static_cast
<
int
>
(
dims
.
size
()),
0
);
std
::
copy
(
dims
.
begin
(),
dims
.
end
(),
pb_dims
->
begin
());
int32_t
size
=
desc
.
ByteSize
();
os
.
write
(
reinterpret_cast
<
const
char
*>
(
&
size
),
sizeof
(
size
));
os
.
write
(
reinterpret_cast
<
const
char
*>
(
&
size
),
sizeof
(
size
));
auto
out
=
desc
.
SerializeAsString
();
os
.
write
(
out
.
data
(),
size
);
}
{
// the 3rd field, tensor data
{
// the 3rd field, tensor data
uint64_t
size
=
tensor
.
memory_size
();
auto
*
data_ptr
=
tensor
.
data
<
void
>
();
auto
*
data_ptr
=
tensor
.
data
<
void
>
();
// PADDLE_ENFORCE(size < std::numeric_limits<std::streamsize>::max(),
// "Index overflow when writing tensor");
os
.
write
(
static_cast
<
const
char
*>
(
data_ptr
),
os
.
write
(
static_cast
<
const
char
*>
(
data_ptr
),
static_cast
<
std
::
streamsize
>
(
size
));
}
}
struct
DeserializedDataFunctor
{
DeserializedDataFunctor
(
void
**
buf
,
Tensor
*
tensor
)
DeserializedDataFunctor
(
void
**
buf
,
Tensor
*
tensor
)
:
buf_
(
buf
),
tensor_
(
tensor
)
{}
template
<
typename
T
>
void
operator
()()
{
template
<
typename
T
>
void
operator
()()
{
*
buf_
=
tensor_
->
mutable_data
<
T
>
();
}
void
**
buf_
;
Tensor
*
tensor_
;
void
**
buf_
;
Tensor
*
tensor_
;
};
void
TensorFromStream
(
std
::
istream
&
is
,
framework
::
Tensor
*
tensor
)
{
void
TensorFromStream
(
std
::
istream
&
is
,
framework
::
Tensor
*
tensor
)
{
uint32_t
version
;
is
.
read
(
reinterpret_cast
<
char
*>
(
&
version
),
sizeof
(
version
));
is
.
read
(
reinterpret_cast
<
char
*>
(
&
version
),
sizeof
(
version
));
// PADDLE_ENFORCE_EQ(version, 0U, "Only version 0 is supported");
proto
::
VarType
::
TensorDesc
desc
;
{
// int32_t size
// proto buffer
{
// int32_t size
// proto buffer
int32_t
size
;
is
.
read
(
reinterpret_cast
<
char
*>
(
&
size
),
sizeof
(
size
));
is
.
read
(
reinterpret_cast
<
char
*>
(
&
size
),
sizeof
(
size
));
std
::
unique_ptr
<
char
[]
>
buf
(
new
char
[
size
]);
is
.
read
(
reinterpret_cast
<
char
*>
(
buf
.
get
()),
size
);
is
.
read
(
reinterpret_cast
<
char
*>
(
buf
.
get
()),
size
);
// PADDLE_ENFORCE(desc.ParseFromArray(buf.get(), size),
// "Cannot parse tensor desc");
}
{
// read tensor
{
// read tensor
std
::
vector
<
int64_t
>
dims
;
dims
.
reserve
(
static_cast
<
size_t
>
(
desc
.
dims
().
size
()));
std
::
copy
(
desc
.
dims
().
begin
(),
desc
.
dims
().
end
(),
std
::
back_inserter
(
dims
));
tensor
->
Resize
(
framework
::
make_ddim
(
dims
));
void
*
buf
;
void
*
buf
;
framework
::
VisitDataType
(
desc
.
data_type
(),
DeserializedDataFunctor
(
&
buf
,
tensor
));
is
.
read
(
static_cast
<
char
*>
(
buf
),
tensor
->
memory_size
());
is
.
read
(
static_cast
<
char
*>
(
buf
),
tensor
->
memory_size
());
}
}
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/framework/tensor_util.h
浏览文件 @
d2f8befa
...
...
@@ -13,54 +13,54 @@ See the License for the specific language governing permissions and
limitations under the License. */
#pragma once
#include <vector>
#include "framework.pb.h"
#include "memory/t_malloc.h"
#include "platform/data_type.h"
#include "tensor.h"
#include <vector>
namespace
paddle_mobile
{
namespace
framework
{
void
TensorCopy
(
const
Tensor
&
src
,
Tensor
*
dst
);
void
TensorCopySync
(
const
Tensor
&
src
,
Tensor
*
dst
);
void
TensorCopy
(
const
Tensor
&
src
,
Tensor
*
dst
);
void
TensorCopySync
(
const
Tensor
&
src
,
Tensor
*
dst
);
template
<
typename
T
>
void
TensorFromVector
(
const
std
::
vector
<
T
>
&
src
,
Tensor
*
dst
);
void
TensorFromVector
(
const
std
::
vector
<
T
>
&
src
,
Tensor
*
dst
);
template
<
typename
T
>
void
TesnorToVector
(
const
Tensor
&
src
,
std
::
vector
<
T
>*
dst
);
void
TesnorToVector
(
const
Tensor
&
src
,
std
::
vector
<
T
>
*
dst
);
bool
TensorContainsNAN
(
const
framework
::
Tensor
&
tensor
);
bool
TensorContainsInf
(
const
framework
::
Tensor
&
tensor
);
bool
TensorContainsNAN
(
const
framework
::
Tensor
&
tensor
);
bool
TensorContainsInf
(
const
framework
::
Tensor
&
tensor
);
void
TensorToStream
(
std
::
ostream
&
os
,
const
Tensor
&
tensor
);
void
TensorFromStream
(
std
::
istream
&
is
,
Tensor
*
tensor
);
void
TensorToStream
(
std
::
ostream
&
os
,
const
Tensor
&
tensor
);
void
TensorFromStream
(
std
::
istream
&
is
,
Tensor
*
tensor
);
//
// The implementation of template functions.
//
template
<
typename
T
>
void
TensorFromVector
(
const
std
::
vector
<
T
>
&
src
,
Tensor
*
dst
)
{
auto
src_ptr
=
static_cast
<
const
void
*>
(
src
.
data
());
void
TensorFromVector
(
const
std
::
vector
<
T
>
&
src
,
Tensor
*
dst
)
{
auto
src_ptr
=
static_cast
<
const
void
*>
(
src
.
data
());
dst
->
Resize
({
static_cast
<
int64_t
>
(
src
.
size
())});
auto
dst_ptr
=
static_cast
<
void
*>
(
dst
->
mutable_data
<
T
>
());
auto
dst_ptr
=
static_cast
<
void
*>
(
dst
->
mutable_data
<
T
>
());
auto
size
=
src
.
size
()
*
sizeof
(
T
);
memory
::
Copy
(
dst_ptr
,
src_ptr
,
size
);
}
template
<
typename
T
>
void
TensorToVector
(
const
Tensor
&
src
,
std
::
vector
<
T
>*
dst
)
{
auto
src_ptr
=
static_cast
<
const
void
*>
(
src
.
data
<
T
>
());
void
TensorToVector
(
const
Tensor
&
src
,
std
::
vector
<
T
>
*
dst
)
{
auto
src_ptr
=
static_cast
<
const
void
*>
(
src
.
data
<
T
>
());
auto
size
=
src
.
numel
()
*
sizeof
(
T
);
dst
->
resize
(
src
.
numel
());
auto
dst_ptr
=
static_cast
<
void
*>
(
dst
->
data
());
auto
dst_ptr
=
static_cast
<
void
*>
(
dst
->
data
());
memory
::
Copy
(
dst_ptr
,
src_ptr
,
size
);
}
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/framework/var_desc.cpp
浏览文件 @
d2f8befa
...
...
@@ -24,5 +24,5 @@ namespace framework {
VarDesc
::
VarDesc
(
const
proto
::
VarDesc
&
desc
)
:
desc_
(
desc
)
{}
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/framework/var_desc.h
浏览文件 @
d2f8befa
...
...
@@ -25,7 +25,7 @@ namespace paddle_mobile {
namespace
framework
{
class
VarDesc
{
public:
public:
VarDesc
(
const
proto
::
VarDesc
&
desc
);
std
::
string
Name
()
const
{
return
desc_
.
name
();
}
...
...
@@ -36,33 +36,33 @@ class VarDesc {
const
proto
::
VarType
::
ChannelDesc
&
channel_desc
()
const
{
switch
(
desc_
.
type
().
type
())
{
case
proto
::
VarType
::
CHANNEL
:
return
desc_
.
type
().
channel
();
default:
break
;
case
proto
::
VarType
::
CHANNEL
:
return
desc_
.
type
().
channel
();
default:
break
;
}
}
const
proto
::
VarType
::
TensorDesc
&
tensor_desc
()
const
{
switch
(
desc_
.
type
().
type
())
{
case
proto
::
VarType
::
SELECTED_ROWS
:
return
desc_
.
type
().
selected_rows
();
case
proto
::
VarType
::
LOD_TENSOR
:
return
desc_
.
type
().
lod_tensor
().
tensor
();
case
proto
::
VarType
::
LOD_TENSOR_ARRAY
:
return
desc_
.
type
().
tensor_array
().
tensor
();
default:
break
;
case
proto
::
VarType
::
SELECTED_ROWS
:
return
desc_
.
type
().
selected_rows
();
case
proto
::
VarType
::
LOD_TENSOR
:
return
desc_
.
type
().
lod_tensor
().
tensor
();
case
proto
::
VarType
::
LOD_TENSOR_ARRAY
:
return
desc_
.
type
().
tensor_array
().
tensor
();
default:
break
;
}
}
proto
::
VarType
::
Type
GetDataType
()
const
{
switch
(
desc_
.
type
().
type
())
{
case
proto
::
VarType
::
CHANNEL
:
return
channel_desc
().
data_type
();
break
;
default:
return
tensor_desc
().
data_type
();
case
proto
::
VarType
::
CHANNEL
:
return
channel_desc
().
data_type
();
break
;
default:
return
tensor_desc
().
data_type
();
}
}
...
...
@@ -80,9 +80,9 @@ class VarDesc {
return
this
->
RepeatedToVector
(
tensor_desc
().
dims
());
}
private:
private:
proto
::
VarDesc
desc_
;
};
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/framework/var_type.h
浏览文件 @
d2f8befa
...
...
@@ -34,5 +34,5 @@ inline proto::VarType::Type ToVarType(std::type_index type) {
}
}
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/framework/variable.h
浏览文件 @
d2f8befa
...
...
@@ -18,42 +18,39 @@ SOFTWARE.
==============================================================================*/
#pragma once
#include "paddle_mobile_object.h"
#include <iostream>
#include <memory>
#include <string>
#include <typeindex>
#include <typeinfo>
#include "paddle_mobile_object.h"
namespace
paddle_mobile
{
namespace
framework
{
class
Variable
:
public
PaddleMobileObject
{
public:
public:
Variable
()
{}
~
Variable
()
{}
template
<
typename
T
>
const
T
*
Get
()
const
{
return
static_cast
<
const
T
*>
(
holder_
->
Ptr
());
template
<
typename
T
>
const
T
*
Get
()
const
{
return
static_cast
<
const
T
*>
(
holder_
->
Ptr
());
}
bool
IsInitialized
()
const
{
return
holder_
!=
nullptr
;
}
const
std
::
string
*
Name
()
{
return
name_
;
}
const
std
::
string
*
Name
()
{
return
name_
;
}
template
<
typename
T
>
T
*
GetMutable
()
{
template
<
typename
T
>
T
*
GetMutable
()
{
if
(
!
IsType
<
T
>
())
{
if
(
*
Name
()
==
"pixel"
)
{
// std::cout << " reset " << *Name() << std::endl;
}
holder_
.
reset
(
new
PlaceholderImp
<
T
>
(
new
T
()));
}
return
static_cast
<
T
*>
(
holder_
->
Ptr
());
return
static_cast
<
T
*>
(
holder_
->
Ptr
());
}
template
<
typename
T
>
bool
IsType
()
const
{
template
<
typename
T
>
bool
IsType
()
const
{
if
(
holder_
)
{
// printf("not null \n");
printf
(
" holder type : %s, this type %s
\n
"
,
holder_
->
Type
().
name
(),
...
...
@@ -69,33 +66,32 @@ class Variable : public PaddleMobileObject {
std
::
type_index
Type
()
const
{
return
holder_
->
Type
();
}
void
SetName
(
const
std
::
string
*
name
)
{
name_
=
name
;
}
void
SetName
(
const
std
::
string
*
name
)
{
name_
=
name
;
}
private:
private:
struct
Placeholder
{
Placeholder
()
=
default
;
virtual
~
Placeholder
()
=
default
;
virtual
const
std
::
type_info
&
Type
()
const
=
0
;
virtual
void
*
Ptr
()
const
=
0
;
virtual
const
std
::
type_info
&
Type
()
const
=
0
;
virtual
void
*
Ptr
()
const
=
0
;
};
template
<
typename
T
>
struct
PlaceholderImp
:
public
Placeholder
{
explicit
PlaceholderImp
(
T
*
ptr
)
:
ptr_
(
ptr
),
type_
(
typeid
(
T
))
{}
template
<
typename
T
>
struct
PlaceholderImp
:
public
Placeholder
{
explicit
PlaceholderImp
(
T
*
ptr
)
:
ptr_
(
ptr
),
type_
(
typeid
(
T
))
{}
virtual
const
std
::
type_info
&
Type
()
const
{
return
type_
;
}
virtual
void
*
Ptr
()
const
override
{
return
static_cast
<
void
*>
(
ptr_
.
get
());
virtual
const
std
::
type_info
&
Type
()
const
{
return
type_
;
}
virtual
void
*
Ptr
()
const
override
{
return
static_cast
<
void
*>
(
ptr_
.
get
());
}
std
::
unique_ptr
<
T
>
ptr_
;
const
std
::
type_info
&
type_
;
const
std
::
type_info
&
type_
;
};
std
::
unique_ptr
<
Placeholder
>
holder_
;
friend
class
Scope
;
const
std
::
string
*
name_
;
const
std
::
string
*
name_
;
};
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/io.cpp
浏览文件 @
d2f8befa
...
...
@@ -45,10 +45,10 @@ void Loader<Dtype, P>::LoadVar(framework::LoDTensor *tensor,
std
::
ifstream
is
(
file_path
);
std
::
streampos
pos
=
is
.
tellg
();
// save current position
std
::
streampos
pos
=
is
.
tellg
();
// save current position
is
.
seekg
(
0
,
std
::
ios
::
end
);
// std::cout << " file length = " << is.tellg() << std::endl;
is
.
seekg
(
pos
);
// restore saved position
is
.
seekg
(
pos
);
// restore saved position
// 1. version
uint32_t
version
;
...
...
@@ -106,34 +106,34 @@ void Loader<Dtype, P>::LoadVar(framework::LoDTensor *tensor,
int
type_size
=
0
;
// std::cout << " desc pre type: ";
switch
(
desc
.
data_type
())
{
case
framework
::
proto
::
VarType
::
FP16
:
// std::cout << "FP16" << std::endl;
type_size
=
2
;
break
;
case
framework
::
proto
::
VarType
::
FP32
:
type_size
=
4
;
memory
=
tensor
->
mutable_data
<
float
>
();
// std::cout << "FP32" << std::endl;
break
;
case
framework
::
proto
::
VarType
::
FP64
:
type_size
=
8
;
// std::cout << "FP64" << std::endl;
break
;
case
framework
::
proto
::
VarType
::
INT32
:
type_size
=
4
;
// std::cout << "INT32" << std::endl;
break
;
case
framework
::
proto
::
VarType
::
INT64
:
type_size
=
8
;
// std::cout << "INT64" << std::endl;
break
;
case
framework
::
proto
::
VarType
::
BOOL
:
type_size
=
1
;
// std::cout << "BOOL" << std::endl;
break
;
default:
break
;
// std::cout << " not support" << std::endl;
case
framework
::
proto
::
VarType
::
FP16
:
// std::cout << "FP16" << std::endl;
type_size
=
2
;
break
;
case
framework
::
proto
::
VarType
::
FP32
:
type_size
=
4
;
memory
=
tensor
->
mutable_data
<
float
>
();
// std::cout << "FP32" << std::endl;
break
;
case
framework
::
proto
::
VarType
::
FP64
:
type_size
=
8
;
// std::cout << "FP64" << std::endl;
break
;
case
framework
::
proto
::
VarType
::
INT32
:
type_size
=
4
;
// std::cout << "INT32" << std::endl;
break
;
case
framework
::
proto
::
VarType
::
INT64
:
type_size
=
8
;
// std::cout << "INT64" << std::endl;
break
;
case
framework
::
proto
::
VarType
::
BOOL
:
type_size
=
1
;
// std::cout << "BOOL" << std::endl;
break
;
default:
break
;
// std::cout << " not support" << std::endl;
}
// std::cout << " malloc size: " << memory_size * type_size << std::endl;
...
...
@@ -143,8 +143,8 @@ void Loader<Dtype, P>::LoadVar(framework::LoDTensor *tensor,
};
template
<
typename
Dtype
,
Precision
P
>
const
framework
::
Program
<
Dtype
,
P
>
Loader
<
Dtype
,
P
>::
Load
(
const
std
::
string
&
dirname
)
{
const
framework
::
Program
<
Dtype
,
P
>
Loader
<
Dtype
,
P
>::
Load
(
const
std
::
string
&
dirname
)
{
std
::
string
model_filename
=
dirname
+
"/__model__"
;
std
::
string
program_desc_str
;
ReadBinaryFile
(
model_filename
,
&
program_desc_str
);
...
...
@@ -217,43 +217,43 @@ const framework::Program<Dtype, P> Loader<Dtype, P>::Load(
// std::cout << " attr type: " << attr.type() << std::endl;
switch
(
attr
.
type
())
{
case
framework
::
proto
::
AttrType
::
BOOLEAN
:
// std::cout << " boolen: " << attr.b() << std::endl;
break
;
case
framework
::
proto
::
AttrType
::
INT
:
// std::cout << " int: " << attr.i() << std::endl;
break
;
case
framework
::
proto
::
AttrType
::
FLOAT
:
// std::cout << " float: " << attr.f() << std::endl;
case
framework
::
proto
::
AttrType
::
STRING
:
// std::cout << " string: " << attr.s() << std::endl;
case
framework
::
proto
::
AttrType
::
BOOLEANS
:
// std::vector<bool>
// bools(attr.bools_size());
for
(
int
y
=
0
;
y
<
attr
.
bools_size
();
++
y
)
{
// std::cout << " bool - " << attr.bools(y) <<
// std::endl;
}
case
framework
::
proto
::
AttrType
::
LONG
:
// std::cout << " long: " << attr.l() << std::endl;
case
framework
::
proto
::
AttrType
::
FLOATS
:
for
(
int
y
=
0
;
y
<
attr
.
floats_size
();
++
y
)
{
// std::cout << " float - " << y << ": " <<
// attr.floats(y)
// << std::endl;
}
case
framework
::
proto
::
AttrType
::
INTS
:
for
(
int
y
=
0
;
y
<
attr
.
ints_size
();
++
y
)
{
// std::cout << " int - " << y << ": " <<
// attr.ints(y)
// << std::endl;
}
case
framework
::
proto
::
AttrType
::
STRINGS
:
for
(
int
y
=
0
;
y
<
attr
.
strings_size
();
++
y
)
{
// std::cout << " string - " << y << ": " <<
// attr.strings(y)
// << std::endl;
}
case
framework
::
proto
::
AttrType
::
BOOLEAN
:
// std::cout << " boolen: " << attr.b() << std::endl;
break
;
case
framework
::
proto
::
AttrType
::
INT
:
// std::cout << " int: " << attr.i() << std::endl;
break
;
case
framework
::
proto
::
AttrType
::
FLOAT
:
// std::cout << " float: " << attr.f() << std::endl;
case
framework
::
proto
::
AttrType
::
STRING
:
// std::cout << " string: " << attr.s() << std::endl;
case
framework
::
proto
::
AttrType
::
BOOLEANS
:
// std::vector<bool>
// bools(attr.bools_size());
for
(
int
y
=
0
;
y
<
attr
.
bools_size
();
++
y
)
{
// std::cout << " bool - " << attr.bools(y) <<
// std::endl;
}
case
framework
::
proto
::
AttrType
::
LONG
:
// std::cout << " long: " << attr.l() << std::endl;
case
framework
::
proto
::
AttrType
::
FLOATS
:
for
(
int
y
=
0
;
y
<
attr
.
floats_size
();
++
y
)
{
// std::cout << " float - " << y << ": " <<
// attr.floats(y)
// << std::endl;
}
case
framework
::
proto
::
AttrType
::
INTS
:
for
(
int
y
=
0
;
y
<
attr
.
ints_size
();
++
y
)
{
// std::cout << " int - " << y << ": " <<
// attr.ints(y)
// << std::endl;
}
case
framework
::
proto
::
AttrType
::
STRINGS
:
for
(
int
y
=
0
;
y
<
attr
.
strings_size
();
++
y
)
{
// std::cout << " string - " << y << ": " <<
// attr.strings(y)
// << std::endl;
}
}
}
}
...
...
@@ -280,10 +280,10 @@ const framework::Program<Dtype, P> Loader<Dtype, P>::Load(
// std::cout << " to load " << var.name() << std::endl;
std
::
string
file_path
=
dirname
+
"/"
+
var
.
name
();
std
::
ifstream
is
(
file_path
);
std
::
streampos
pos
=
is
.
tellg
();
// save current position
std
::
streampos
pos
=
is
.
tellg
();
// save current position
is
.
seekg
(
0
,
std
::
ios
::
end
);
// std::cout << " file length = " << is.tellg() << std::endl;
is
.
seekg
(
pos
);
// restore saved position
is
.
seekg
(
pos
);
// restore saved position
// 1. version
uint32_t
version
;
...
...
@@ -333,33 +333,33 @@ const framework::Program<Dtype, P> Loader<Dtype, P>::Load(
int
type_size
=
0
;
// std::cout << " desc pre type: ";
switch
(
desc
.
data_type
())
{
case
framework
::
proto
::
VarType
::
FP16
:
// std::cout << "FP16" << std::endl;
type_size
=
2
;
break
;
case
framework
::
proto
::
VarType
::
FP32
:
type_size
=
4
;
// std::cout << "FP32" << std::endl;
break
;
case
framework
::
proto
::
VarType
::
FP64
:
type_size
=
8
;
// std::cout << "FP64" << std::endl;
break
;
case
framework
::
proto
::
VarType
::
INT32
:
type_size
=
4
;
// std::cout << "INT32" << std::endl;
break
;
case
framework
::
proto
::
VarType
::
INT64
:
type_size
=
8
;
// std::cout << "INT64" << std::endl;
break
;
case
framework
::
proto
::
VarType
::
BOOL
:
type_size
=
1
;
// std::cout << "BOOL" << std::endl;
break
;
default:
break
;
// std::cout << " not support" << std::endl;
case
framework
::
proto
::
VarType
::
FP16
:
// std::cout << "FP16" << std::endl;
type_size
=
2
;
break
;
case
framework
::
proto
::
VarType
::
FP32
:
type_size
=
4
;
// std::cout << "FP32" << std::endl;
break
;
case
framework
::
proto
::
VarType
::
FP64
:
type_size
=
8
;
// std::cout << "FP64" << std::endl;
break
;
case
framework
::
proto
::
VarType
::
INT32
:
type_size
=
4
;
// std::cout << "INT32" << std::endl;
break
;
case
framework
::
proto
::
VarType
::
INT64
:
type_size
=
8
;
// std::cout << "INT64" << std::endl;
break
;
case
framework
::
proto
::
VarType
::
BOOL
:
type_size
=
1
;
// std::cout << "BOOL" << std::endl;
break
;
default:
break
;
// std::cout << " not support" << std::endl;
}
// std::cout << " malloc size: " << memory_size * type_size
...
...
@@ -381,4 +381,4 @@ const framework::Program<Dtype, P> Loader<Dtype, P>::Load(
template
class
Loader
<
CPU
,
Precision
::
FP32
>;
}
// namespace paddle_mobile
}
// namespace paddle_mobile
src/io.h
浏览文件 @
d2f8befa
...
...
@@ -29,11 +29,11 @@ namespace paddle_mobile {
template
<
typename
Dtype
,
Precision
P
=
Precision
::
FP32
>
class
Loader
:
PaddleMobileObject
{
public:
public:
const
framework
::
Program
<
Dtype
,
P
>
Load
(
const
std
::
string
&
dirname
);
private:
private:
void
LoadVar
(
framework
::
LoDTensor
*
tensor
,
const
std
::
string
&
file_path
);
};
}
// namespace paddle_mobile
}
// namespace paddle_mobile
src/memory/t_malloc.cc
浏览文件 @
d2f8befa
...
...
@@ -47,5 +47,5 @@ void Free(void *ptr) {
}
}
}
// namespace memory
}
// namespace paddle_mobile
}
// namespace memory
}
// namespace paddle_mobile
src/memory/t_malloc.h
浏览文件 @
d2f8befa
...
...
@@ -37,11 +37,10 @@ void Free(void *ptr);
* std::unique_ptr<T> in tensor.h.
* static_cast
*/
template
<
typename
T
>
class
PODDeleter
{
template
<
typename
T
>
class
PODDeleter
{
static_assert
(
std
::
is_pod
<
T
>::
value
,
"T must be POD"
);
public:
public:
explicit
PODDeleter
(){};
void
operator
()(
T
*
ptr
)
{
Free
(
static_cast
<
void
*>
(
ptr
));
}
...
...
@@ -55,12 +54,11 @@ class PODDeleter {
* std::unique_ptr<T> in tensor.h.
* reinterpret_cast
*/
template
<
typename
T
>
class
PlainDeleter
{
public:
template
<
typename
T
>
class
PlainDeleter
{
public:
explicit
PlainDeleter
(){};
void
operator
()(
T
*
ptr
)
{
Free
(
reinterpret_cast
<
void
*>
(
ptr
));
}
};
}
// namespace memory
}
// namespace paddle_mobile
}
// namespace memory
}
// namespace paddle_mobile
src/operators/conv_op.cpp
浏览文件 @
d2f8befa
...
...
@@ -72,5 +72,5 @@ void ConvOp<Dtype, T>::InferShape() const {
template
class
ConvOp
<
CPU
,
float
>;
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace operators
}
// namespace paddle_mobile
src/operators/conv_op.h
浏览文件 @
d2f8befa
...
...
@@ -28,9 +28,9 @@ using namespace framework;
template
<
typename
DeviceType
,
typename
T
>
class
ConvOp
:
public
framework
::
OperatorWithKernel
<
DeviceType
>
{
public:
ConvOp
(
const
std
::
string
&
type
,
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
framework
::
AttributeMap
&
attrs
,
public:
ConvOp
(
const
std
::
string
&
type
,
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
framework
::
AttributeMap
&
attrs
,
std
::
shared_ptr
<
framework
::
Scope
>
scope
)
:
framework
::
OperatorWithKernel
<
DeviceType
>
(
type
,
inputs
,
outputs
,
attrs
,
scope
),
...
...
@@ -39,7 +39,7 @@ class ConvOp : public framework::OperatorWithKernel<DeviceType> {
using
framework
::
OperatorWithKernel
<
DeviceType
>::
OperatorWithKernel
;
void
InferShape
()
const
override
;
protected:
protected:
void
RunImpl
()
const
{
operators
::
ConvKernel
<
DeviceType
,
T
,
ConvParam
>
kernel
;
kernel
.
Compute
(
param_
);
...
...
@@ -48,5 +48,5 @@ class ConvOp : public framework::OperatorWithKernel<DeviceType> {
ConvParam
param_
;
};
}
// operators
}
// paddle_mobile
}
// operators
}
// paddle_mobile
src/operators/kernel/arm/conv_kernel.cpp
浏览文件 @
d2f8befa
...
...
@@ -21,9 +21,9 @@ SOFTWARE.
namespace
paddle_mobile
{
namespace
operators
{
bool
IsExpand
(
const
std
::
vector
<
int64_t
>
&
filter_dim
,
const
std
::
vector
<
int
>
&
strides
,
const
std
::
vector
<
int
>&
paddings
,
const
std
::
vector
<
int
>
&
dilations
)
{
bool
IsExpand
(
const
std
::
vector
<
int64_t
>
&
filter_dim
,
const
std
::
vector
<
int
>
&
strides
,
const
std
::
vector
<
int
>
&
paddings
,
const
std
::
vector
<
int
>
&
dilations
)
{
bool
filter_1
=
true
,
strides_1
=
true
,
padding_0
=
true
,
dilation_1
=
true
;
for
(
size_t
j
=
0
;
j
<
strides
.
size
();
++
j
)
{
filter_1
=
filter_1
&&
(
static_cast
<
int
>
(
filter_dim
[
j
+
2
])
==
1
);
...
...
@@ -35,8 +35,8 @@ bool IsExpand(const std::vector<int64_t>& filter_dim,
}
template
<
>
void
ConvKernel
<
CPU
,
float
,
ConvParam
>::
Compute
(
const
ConvParam
&
param
)
const
{
const
Tensor
*
input
=
param
.
Input
();
void
ConvKernel
<
CPU
,
float
,
ConvParam
>::
Compute
(
const
ConvParam
&
param
)
const
{
const
Tensor
*
input
=
param
.
Input
();
std
::
cout
<<
" conv param "
<<
param
<<
std
::
endl
;
...
...
@@ -45,7 +45,7 @@ void ConvKernel<CPU, float, ConvParam>::Compute(const ConvParam& param) const {
// that avoids modifying the variable in the Scope.
Tensor
filter
=
*
param
.
Filter
();
Tensor
*
output
=
param
.
Output
();
Tensor
*
output
=
param
.
Output
();
// output->mutable_data<T>(context.GetPlace());
int
groups
=
param
.
Groups
();
...
...
@@ -149,5 +149,5 @@ void ConvKernel<CPU, float, ConvParam>::Compute(const ConvParam& param) const {
template
class
ConvKernel
<
CPU
,
float
,
ConvParam
>;
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace operators
}
// namespace paddle_mobile
src/operators/kernel/conv_kernel.h
浏览文件 @
d2f8befa
...
...
@@ -31,7 +31,7 @@ using namespace framework;
template
<
typename
DeviceType
,
typename
T
,
typename
P
>
class
ConvKernel
:
public
framework
::
OpKernelBase
<
DeviceType
,
ConvParam
>
{
public:
public:
void
Compute
(
const
ConvParam
&
param
)
const
;
};
}
...
...
src/operators/math/im2col.cc
浏览文件 @
d2f8befa
...
...
@@ -24,12 +24,11 @@ namespace math {
* col =
* [input_channels, filter_height, filter_width, output_height, output_width]
*/
template
<
class
T
>
class
Im2ColFunctor
<
ColFormat
::
kCFO
,
CPU
,
T
>
{
public:
void
operator
()(
const
framework
::
Tensor
&
im
,
const
std
::
vector
<
int
>&
dilation
,
const
std
::
vector
<
int
>&
stride
,
const
std
::
vector
<
int
>&
padding
,
framework
::
Tensor
*
col
)
{
template
<
class
T
>
class
Im2ColFunctor
<
ColFormat
::
kCFO
,
CPU
,
T
>
{
public:
void
operator
()(
const
framework
::
Tensor
&
im
,
const
std
::
vector
<
int
>
&
dilation
,
const
std
::
vector
<
int
>
&
stride
,
const
std
::
vector
<
int
>
&
padding
,
framework
::
Tensor
*
col
)
{
// PADDLE_ENFORCE(im.dims().size() == 3);
// PADDLE_ENFORCE(col->dims().size() == 5);
...
...
@@ -58,8 +57,8 @@ class Im2ColFunctor<ColFormat::kCFO, CPU, T> {
int
channels_col
=
im_channels
*
filter_height
*
filter_width
;
const
T
*
im_data
=
im
.
data
<
T
>
();
T
*
col_data
=
col
->
data
<
T
>
();
const
T
*
im_data
=
im
.
data
<
T
>
();
T
*
col_data
=
col
->
data
<
T
>
();
for
(
int
c
=
0
;
c
<
channels_col
;
++
c
)
{
int
w_offset
=
c
%
filter_width
;
int
h_offset
=
(
c
/
filter_width
)
%
filter_height
;
...
...
@@ -86,13 +85,12 @@ class Im2ColFunctor<ColFormat::kCFO, CPU, T> {
* col =
* [input_channels, filter_height, filter_width, output_height, output_width]
*/
template
<
class
T
>
class
Col2ImFunctor
<
ColFormat
::
kCFO
,
CPU
,
T
>
{
public:
void
operator
()(
const
framework
::
Tensor
&
col
,
const
std
::
vector
<
int
>&
dilation
,
const
std
::
vector
<
int
>&
stride
,
const
std
::
vector
<
int
>&
padding
,
framework
::
Tensor
*
im
)
{
template
<
class
T
>
class
Col2ImFunctor
<
ColFormat
::
kCFO
,
CPU
,
T
>
{
public:
void
operator
()(
const
framework
::
Tensor
&
col
,
const
std
::
vector
<
int
>
&
dilation
,
const
std
::
vector
<
int
>
&
stride
,
const
std
::
vector
<
int
>
&
padding
,
framework
::
Tensor
*
im
)
{
// PADDLE_ENFORCE(im->dims().size() == 3);
// PADDLE_ENFORCE(col.dims().size() == 5);
int
im_channels
=
im
->
dims
()[
0
];
...
...
@@ -120,8 +118,8 @@ class Col2ImFunctor<ColFormat::kCFO, CPU, T> {
int
channels_col
=
im_channels
*
filter_height
*
filter_width
;
T
*
im_data
=
im
->
data
<
T
>
();
const
T
*
col_data
=
col
.
data
<
T
>
();
T
*
im_data
=
im
->
data
<
T
>
();
const
T
*
col_data
=
col
.
data
<
T
>
();
for
(
int
c
=
0
;
c
<
channels_col
;
++
c
)
{
int
w_offset
=
c
%
filter_width
;
...
...
@@ -152,12 +150,11 @@ template class Col2ImFunctor<ColFormat::kCFO, CPU, double>;
* col =
* [output_height, output_width, input_channels, filter_height, filter_width]
*/
template
<
class
T
>
class
Im2ColFunctor
<
ColFormat
::
kOCF
,
CPU
,
T
>
{
public:
void
operator
()(
const
framework
::
Tensor
&
im
,
const
std
::
vector
<
int
>&
dilation
,
const
std
::
vector
<
int
>&
stride
,
const
std
::
vector
<
int
>&
padding
,
framework
::
Tensor
*
col
)
{
template
<
class
T
>
class
Im2ColFunctor
<
ColFormat
::
kOCF
,
CPU
,
T
>
{
public:
void
operator
()(
const
framework
::
Tensor
&
im
,
const
std
::
vector
<
int
>
&
dilation
,
const
std
::
vector
<
int
>
&
stride
,
const
std
::
vector
<
int
>
&
padding
,
framework
::
Tensor
*
col
)
{
// PADDLE_ENFORCE(im.dims().size() == 3);
// PADDLE_ENFORCE(col->dims().size() == 5);
int
im_channels
=
im
.
dims
()[
0
];
...
...
@@ -177,8 +174,8 @@ class Im2ColFunctor<ColFormat::kOCF, CPU, T> {
// 1, col_width, "col_width and padding(padding_left, padding_right)
// are " "inconsistent.");
const
T
*
im_data
=
im
.
data
<
T
>
();
T
*
col_data
=
col
->
data
<
T
>
();
const
T
*
im_data
=
im
.
data
<
T
>
();
T
*
col_data
=
col
->
data
<
T
>
();
for
(
int
col_row_idx
=
0
;
col_row_idx
<
col_height
;
++
col_row_idx
)
{
for
(
int
col_col_idx
=
0
;
col_col_idx
<
col_width
;
++
col_col_idx
)
{
...
...
@@ -220,13 +217,12 @@ class Im2ColFunctor<ColFormat::kOCF, CPU, T> {
* col =
* [output_height, output_width, input_channels, filter_height, filter_width]
*/
template
<
class
T
>
class
Col2ImFunctor
<
ColFormat
::
kOCF
,
CPU
,
T
>
{
public:
void
operator
()(
const
framework
::
Tensor
&
col
,
const
std
::
vector
<
int
>&
dilation
,
const
std
::
vector
<
int
>&
stride
,
const
std
::
vector
<
int
>&
padding
,
framework
::
Tensor
*
im
)
{
template
<
class
T
>
class
Col2ImFunctor
<
ColFormat
::
kOCF
,
CPU
,
T
>
{
public:
void
operator
()(
const
framework
::
Tensor
&
col
,
const
std
::
vector
<
int
>
&
dilation
,
const
std
::
vector
<
int
>
&
stride
,
const
std
::
vector
<
int
>
&
padding
,
framework
::
Tensor
*
im
)
{
// PADDLE_ENFORCE(im->dims().size() == 3);
// PADDLE_ENFORCE(col.dims().size() == 5);
int
im_channels
=
im
->
dims
()[
0
];
...
...
@@ -246,8 +242,8 @@ class Col2ImFunctor<ColFormat::kOCF, CPU, T> {
// 1, col_width, "col_width and padding(padding_left, padding_right)
// are " "inconsistent.");
T
*
im_data
=
im
->
data
<
T
>
();
const
T
*
col_data
=
col
.
data
<
T
>
();
T
*
im_data
=
im
->
data
<
T
>
();
const
T
*
col_data
=
col
.
data
<
T
>
();
for
(
int
col_row_idx
=
0
;
col_row_idx
<
col_height
;
++
col_row_idx
)
{
for
(
int
col_col_idx
=
0
;
col_col_idx
<
col_width
;
++
col_col_idx
)
{
...
...
@@ -289,6 +285,6 @@ template class Im2ColFunctor<ColFormat::kOCF, CPU, double>;
template
class
Col2ImFunctor
<
ColFormat
::
kOCF
,
CPU
,
float
>;
template
class
Col2ImFunctor
<
ColFormat
::
kOCF
,
CPU
,
double
>;
}
// namespace math
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace math
}
// namespace operators
}
// namespace paddle_mobile
src/operators/math/im2col.h
浏览文件 @
d2f8befa
...
...
@@ -79,21 +79,21 @@ enum class ColFormat { kCFO = 0, kOCF = 1 };
*/
template
<
ColFormat
Format
,
typename
DeviceType
,
typename
T
>
class
Im2ColFunctor
{
public:
void
operator
()(
const
framework
::
Tensor
&
im
,
const
std
::
vector
<
int
>&
dilation
,
const
std
::
vector
<
int
>
&
stride
,
const
std
::
vector
<
int
>
&
padding
,
framework
::
Tensor
*
col
);
public:
void
operator
()(
const
framework
::
Tensor
&
im
,
const
std
::
vector
<
int
>
&
dilation
,
const
std
::
vector
<
int
>
&
stride
,
const
std
::
vector
<
int
>
&
padding
,
framework
::
Tensor
*
col
);
};
template
<
ColFormat
Format
,
typename
DeviceType
,
typename
T
>
class
Col2ImFunctor
{
public:
void
operator
()(
const
framework
::
Tensor
&
col
,
const
std
::
vector
<
int
>
&
dilation
,
const
std
::
vector
<
int
>
&
stride
,
const
std
::
vector
<
int
>
&
padding
,
framework
::
Tensor
*
im
);
public:
void
operator
()(
const
framework
::
Tensor
&
col
,
const
std
::
vector
<
int
>
&
dilation
,
const
std
::
vector
<
int
>
&
stride
,
const
std
::
vector
<
int
>
&
padding
,
framework
::
Tensor
*
im
);
};
}
// namespace math
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace math
}
// namespace operators
}
// namespace paddle_mobile
src/operators/math/math_function.cc
浏览文件 @
d2f8befa
...
...
@@ -21,7 +21,7 @@ namespace math {
template
<
>
void
gemm
<
float
>
(
const
CBLAS_TRANSPOSE
transA
,
const
CBLAS_TRANSPOSE
transB
,
const
int
M
,
const
int
N
,
const
int
K
,
const
float
alpha
,
const
float
*
A
,
const
float
*
B
,
const
float
beta
,
float
*
C
)
{
const
float
*
A
,
const
float
*
B
,
const
float
beta
,
float
*
C
)
{
int
lda
=
(
transA
==
CblasNoTrans
)
?
K
:
M
;
int
ldb
=
(
transB
==
CblasNoTrans
)
?
N
:
K
;
int
ldc
=
N
;
...
...
@@ -32,8 +32,8 @@ void gemm<float>(const CBLAS_TRANSPOSE transA, const CBLAS_TRANSPOSE transB,
template
<
>
void
gemm
<
double
>
(
const
CBLAS_TRANSPOSE
transA
,
const
CBLAS_TRANSPOSE
transB
,
const
int
M
,
const
int
N
,
const
int
K
,
const
double
alpha
,
const
double
*
A
,
const
double
*
B
,
const
double
beta
,
double
*
C
)
{
const
double
*
A
,
const
double
*
B
,
const
double
beta
,
double
*
C
)
{
int
lda
=
(
transA
==
CblasNoTrans
)
?
K
:
M
;
int
ldb
=
(
transB
==
CblasNoTrans
)
?
N
:
K
;
int
ldc
=
N
;
...
...
@@ -43,8 +43,8 @@ void gemm<double>(const CBLAS_TRANSPOSE transA, const CBLAS_TRANSPOSE transB,
template
<
>
void
gemm
<
float
>
(
const
bool
transA
,
const
bool
transB
,
const
int
M
,
const
int
N
,
const
int
K
,
const
float
alpha
,
const
float
*
A
,
const
int
lda
,
const
float
*
B
,
const
int
ldb
,
const
float
beta
,
float
*
C
,
const
int
K
,
const
float
alpha
,
const
float
*
A
,
const
int
lda
,
const
float
*
B
,
const
int
ldb
,
const
float
beta
,
float
*
C
,
const
int
ldc
)
{
cblas_sgemm
(
CblasRowMajor
,
transA
==
false
?
CblasNoTrans
:
CblasTrans
,
transB
==
false
?
CblasNoTrans
:
CblasTrans
,
M
,
N
,
K
,
alpha
,
A
,
...
...
@@ -53,18 +53,18 @@ void gemm<float>(const bool transA, const bool transB, const int M, const int N,
template
<
>
void
gemm
<
double
>
(
const
bool
transA
,
const
bool
transB
,
const
int
M
,
const
int
N
,
const
int
K
,
const
double
alpha
,
const
double
*
A
,
const
int
lda
,
const
double
*
B
,
const
int
ldb
,
const
double
beta
,
double
*
C
,
const
int
ldc
)
{
const
int
N
,
const
int
K
,
const
double
alpha
,
const
double
*
A
,
const
int
lda
,
const
double
*
B
,
const
int
ldb
,
const
double
beta
,
double
*
C
,
const
int
ldc
)
{
cblas_dgemm
(
CblasRowMajor
,
transA
==
false
?
CblasNoTrans
:
CblasTrans
,
transB
==
false
?
CblasNoTrans
:
CblasTrans
,
M
,
N
,
K
,
alpha
,
A
,
lda
,
B
,
ldb
,
beta
,
C
,
ldc
);
}
template
<
>
void
matmul
<
float
>
(
const
framework
::
Tensor
&
matrix_a
,
bool
trans_a
,
const
framework
::
Tensor
&
matrix_b
,
bool
trans_b
,
float
alpha
,
framework
::
Tensor
*
matrix_out
,
float
beta
)
{
void
matmul
<
float
>
(
const
framework
::
Tensor
&
matrix_a
,
bool
trans_a
,
const
framework
::
Tensor
&
matrix_b
,
bool
trans_b
,
float
alpha
,
framework
::
Tensor
*
matrix_out
,
float
beta
)
{
auto
dim_a
=
matrix_a
.
dims
();
auto
dim_b
=
matrix_b
.
dims
();
auto
dim_out
=
matrix_out
->
dims
();
...
...
@@ -89,9 +89,9 @@ void matmul<float>(const framework::Tensor& matrix_a, bool trans_a,
}
template
<
>
void
matmul
<
double
>
(
const
framework
::
Tensor
&
matrix_a
,
bool
trans_a
,
const
framework
::
Tensor
&
matrix_b
,
bool
trans_b
,
double
alpha
,
framework
::
Tensor
*
matrix_out
,
double
beta
)
{
void
matmul
<
double
>
(
const
framework
::
Tensor
&
matrix_a
,
bool
trans_a
,
const
framework
::
Tensor
&
matrix_b
,
bool
trans_b
,
double
alpha
,
framework
::
Tensor
*
matrix_out
,
double
beta
)
{
auto
dim_a
=
matrix_a
.
dims
();
auto
dim_b
=
matrix_b
.
dims
();
auto
dim_out
=
matrix_out
->
dims
();
...
...
@@ -115,6 +115,6 @@ void matmul<double>(const framework::Tensor& matrix_a, bool trans_a,
matrix_b
.
data
<
double
>
(),
beta
,
matrix_out
->
data
<
double
>
());
}
}
// namespace math
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace math
}
// namespace operators
}
// namespace paddle_mobile
src/operators/math/math_function.h
浏览文件 @
d2f8befa
...
...
@@ -14,9 +14,9 @@ limitations under the License. */
#pragma once
#include "framework/tensor.h"
#include <cblas.h>
#include <cmath>
#include "framework/tensor.h"
namespace
paddle_mobile
{
namespace
operators
{
...
...
@@ -24,19 +24,19 @@ namespace math {
template
<
typename
T
>
void
gemm
(
const
CBLAS_TRANSPOSE
transA
,
const
CBLAS_TRANSPOSE
transB
,
const
int
M
,
const
int
N
,
const
int
K
,
const
T
alpha
,
const
T
*
A
,
const
T
*
B
,
const
T
beta
,
T
*
C
);
const
int
M
,
const
int
N
,
const
int
K
,
const
T
alpha
,
const
T
*
A
,
const
T
*
B
,
const
T
beta
,
T
*
C
);
template
<
typename
T
>
void
gemm
(
const
bool
transA
,
const
bool
transB
,
const
int
M
,
const
int
N
,
const
int
K
,
const
T
alpha
,
const
T
*
A
,
const
int
lda
,
const
T
*
B
,
const
int
ldb
,
const
T
beta
,
T
*
C
,
const
int
ldc
);
const
int
K
,
const
T
alpha
,
const
T
*
A
,
const
int
lda
,
const
T
*
B
,
const
int
ldb
,
const
T
beta
,
T
*
C
,
const
int
ldc
);
// matrix multiply with continuous memory
template
<
typename
T
>
void
matmul
(
const
framework
::
Tensor
&
matrix_a
,
bool
trans_a
,
const
framework
::
Tensor
&
matrix_b
,
bool
trans_b
,
T
alpha
,
framework
::
Tensor
*
matrix_out
,
T
beta
);
}
// namespace math
}
// namespace operators
}
// namespace paddle_mobile
void
matmul
(
const
framework
::
Tensor
&
matrix_a
,
bool
trans_a
,
const
framework
::
Tensor
&
matrix_b
,
bool
trans_b
,
T
alpha
,
framework
::
Tensor
*
matrix_out
,
T
beta
);
}
// namespace math
}
// namespace operators
}
// namespace paddle_mobile
src/operators/math/vol2col.cc
浏览文件 @
d2f8befa
...
...
@@ -25,12 +25,11 @@ using Tensor = paddle_mobile::framework::Tensor;
* [input_channels, filter_depth, filter_height, filter_width,
* output_depth, output_height, output_width]
*/
template
<
typename
T
>
class
Vol2ColFunctor
<
CPU
,
T
>
{
public:
void
operator
()(
const
Tensor
&
vol
,
const
std
::
vector
<
int
>&
dilations
,
const
std
::
vector
<
int
>&
strides
,
const
std
::
vector
<
int
>&
paddings
,
Tensor
*
col
)
const
{
template
<
typename
T
>
class
Vol2ColFunctor
<
CPU
,
T
>
{
public:
void
operator
()(
const
Tensor
&
vol
,
const
std
::
vector
<
int
>
&
dilations
,
const
std
::
vector
<
int
>
&
strides
,
const
std
::
vector
<
int
>
&
paddings
,
Tensor
*
col
)
const
{
// PADDLE_ENFORCE(vol.dims().size() == 4);
// PADDLE_ENFORCE(col->dims().size() == 7);
...
...
@@ -69,8 +68,8 @@ class Vol2ColFunctor<CPU, T> {
// "input_width and output_width are "
// "mismatching.");
const
T
*
vol_data
=
vol
.
data
<
T
>
();
T
*
col_data
=
col
->
data
<
T
>
();
const
T
*
vol_data
=
vol
.
data
<
T
>
();
T
*
col_data
=
col
->
data
<
T
>
();
for
(
int
c
=
0
;
c
<
channels_col
;
++
c
)
{
int
w_offset
=
c
%
filter_width
;
...
...
@@ -108,12 +107,11 @@ class Vol2ColFunctor<CPU, T> {
* [input_channels, filter_depth, filter_height, filter_width,
* output_depth, output_height, output_width]
*/
template
<
typename
T
>
class
Col2VolFunctor
<
CPU
,
T
>
{
public:
void
operator
()(
const
Tensor
&
col
,
const
std
::
vector
<
int
>&
dilations
,
const
std
::
vector
<
int
>&
strides
,
const
std
::
vector
<
int
>&
paddings
,
Tensor
*
vol
)
const
{
template
<
typename
T
>
class
Col2VolFunctor
<
CPU
,
T
>
{
public:
void
operator
()(
const
Tensor
&
col
,
const
std
::
vector
<
int
>
&
dilations
,
const
std
::
vector
<
int
>
&
strides
,
const
std
::
vector
<
int
>
&
paddings
,
Tensor
*
vol
)
const
{
// PADDLE_ENFORCE(vol->dims().size() == 4);
// PADDLE_ENFORCE(col.dims().size() == 7);
...
...
@@ -151,8 +149,8 @@ class Col2VolFunctor<CPU, T> {
// output_width,
// "input_width and output_width are "
// "mismatching.");
T
*
vol_data
=
vol
->
data
<
T
>
();
const
T
*
col_data
=
col
.
data
<
T
>
();
T
*
vol_data
=
vol
->
data
<
T
>
();
const
T
*
col_data
=
col
.
data
<
T
>
();
for
(
int
c
=
0
;
c
<
channels_col
;
++
c
)
{
int
w_offset
=
c
%
filter_width
;
...
...
@@ -190,6 +188,6 @@ template class Vol2ColFunctor<CPU, double>;
template
class
Col2VolFunctor
<
CPU
,
float
>;
template
class
Col2VolFunctor
<
CPU
,
double
>;
}
// namespace math
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace math
}
// namespace operators
}
// namespace paddle_mobile
src/operators/math/vol2col.h
浏览文件 @
d2f8befa
...
...
@@ -64,22 +64,20 @@ namespace math {
*/
using
Tensor
=
paddle_mobile
::
framework
::
Tensor
;
template
<
typename
DeviceType
,
typename
T
>
class
Vol2ColFunctor
{
public:
void
operator
()(
const
Tensor
&
vol
,
const
std
::
vector
<
int
>&
dilations
,
const
std
::
vector
<
int
>&
strides
,
const
std
::
vector
<
int
>&
paddings
,
Tensor
*
col
)
const
;
template
<
typename
DeviceType
,
typename
T
>
class
Vol2ColFunctor
{
public:
void
operator
()(
const
Tensor
&
vol
,
const
std
::
vector
<
int
>
&
dilations
,
const
std
::
vector
<
int
>
&
strides
,
const
std
::
vector
<
int
>
&
paddings
,
Tensor
*
col
)
const
;
};
template
<
typename
DeviceType
,
typename
T
>
class
Col2VolFunctor
{
public:
void
operator
()(
const
Tensor
&
col
,
const
std
::
vector
<
int
>&
dilations
,
const
std
::
vector
<
int
>&
strides
,
const
std
::
vector
<
int
>&
paddings
,
Tensor
*
vol
)
const
;
template
<
typename
DeviceType
,
typename
T
>
class
Col2VolFunctor
{
public:
void
operator
()(
const
Tensor
&
col
,
const
std
::
vector
<
int
>
&
dilations
,
const
std
::
vector
<
int
>
&
strides
,
const
std
::
vector
<
int
>
&
paddings
,
Tensor
*
vol
)
const
;
};
}
// namespace math
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace math
}
// namespace operators
}
// namespace paddle_mobile
src/operators/op_param.cpp
浏览文件 @
d2f8befa
...
...
@@ -21,7 +21,7 @@ SOFTWARE.
namespace
paddle_mobile
{
namespace
operators
{
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
ConvParam
&
conv_param
)
{
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
ConvParam
&
conv_param
)
{
os
<<
"parameter of conv: "
<<
std
::
endl
;
os
<<
" stride: "
<<
" ("
<<
conv_param
.
Strides
()[
0
]
<<
conv_param
.
Strides
()[
1
]
<<
") "
...
...
@@ -39,5 +39,5 @@ std::ostream& operator<<(std::ostream& os, const ConvParam& conv_param) {
return
os
;
}
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace operators
}
// namespace paddle_mobile
src/operators/op_param.h
浏览文件 @
d2f8befa
...
...
@@ -30,8 +30,8 @@ namespace operators {
using
namespace
framework
;
class
OpParam
:
PaddleMobileObject
{
public:
protected:
public:
protected:
template
<
typename
T
>
static
T
*
InputFrom
(
const
VariableNameMap
&
inputs
,
const
Scope
&
scope
)
{
return
GetVarValue
<
T
>
(
"Input"
,
inputs
,
scope
);
...
...
@@ -67,7 +67,7 @@ class OpParam : PaddleMobileObject {
};
class
ConvParam
:
OpParam
{
public:
public:
ConvParam
(
const
VariableNameMap
&
inputs
,
const
VariableNameMap
&
outputs
,
const
framework
::
AttributeMap
&
attrs
,
const
framework
::
Scope
&
scope
)
{
...
...
@@ -94,7 +94,7 @@ class ConvParam : OpParam {
const
int
&
Groups
()
const
{
return
groups
;
}
private:
private:
Tensor
*
input_
;
Tensor
*
output_
;
LoDTensor
*
filter_
;
...
...
@@ -106,5 +106,5 @@ class ConvParam : OpParam {
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
ConvParam
&
conv_param
);
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace operators
}
// namespace paddle_mobile
src/platform/data_type.h
浏览文件 @
d2f8befa
...
...
@@ -14,9 +14,9 @@ limitations under the License. */
#pragma once
#include "framework/framework.pb.h"
#include <string>
#include <typeindex>
#include "framework/framework.pb.h"
namespace
paddle_mobile
{
namespace
framework
{
...
...
@@ -47,70 +47,70 @@ inline proto::VarType::Type ToDataType(std::type_index type) {
inline
std
::
type_index
ToTypeIndex
(
proto
::
VarType
::
Type
type
)
{
switch
(
type
)
{
// case proto::VarType::FP16:
// return typeid(platform::float16);
case
proto
::
VarType
::
FP32
:
return
typeid
(
float
);
case
proto
::
VarType
::
FP64
:
return
typeid
(
double
);
case
proto
::
VarType
::
INT32
:
return
typeid
(
int
);
case
proto
::
VarType
::
INT64
:
return
typeid
(
int64_t
);
case
proto
::
VarType
::
BOOL
:
return
typeid
(
bool
);
default:
// PADDLE_THROW("Not support type %d", type);
printf
(
"Not support type %d"
,
type
);
// case proto::VarType::FP16:
// return typeid(platform::float16);
case
proto
::
VarType
::
FP32
:
return
typeid
(
float
);
case
proto
::
VarType
::
FP64
:
return
typeid
(
double
);
case
proto
::
VarType
::
INT32
:
return
typeid
(
int
);
case
proto
::
VarType
::
INT64
:
return
typeid
(
int64_t
);
case
proto
::
VarType
::
BOOL
:
return
typeid
(
bool
);
default:
// PADDLE_THROW("Not support type %d", type);
printf
(
"Not support type %d"
,
type
);
}
}
template
<
typename
Visitor
>
inline
void
VisitDataType
(
proto
::
VarType
::
Type
type
,
Visitor
visitor
)
{
switch
(
type
)
{
// case proto::VarType::FP16:
// visitor.template operator()<platform::float16>();
// break;
case
proto
::
VarType
::
FP32
:
visitor
.
template
operator
()
<
float
>();
break
;
case
proto
::
VarType
::
FP64
:
visitor
.
template
operator
()
<
double
>();
break
;
case
proto
::
VarType
::
INT32
:
visitor
.
template
operator
()
<
int
>();
break
;
case
proto
::
VarType
::
INT64
:
visitor
.
template
operator
()
<
int64_t
>();
break
;
case
proto
::
VarType
::
BOOL
:
visitor
.
template
operator
()
<
bool
>();
break
;
default:
// PADDLE_THROW("Not supported");
printf
(
"Not supported"
);
// case proto::VarType::FP16:
// visitor.template operator()<platform::float16>();
// break;
case
proto
::
VarType
::
FP32
:
visitor
.
template
operator
()
<
float
>();
break
;
case
proto
::
VarType
::
FP64
:
visitor
.
template
operator
()
<
double
>();
break
;
case
proto
::
VarType
::
INT32
:
visitor
.
template
operator
()
<
int
>();
break
;
case
proto
::
VarType
::
INT64
:
visitor
.
template
operator
()
<
int64_t
>();
break
;
case
proto
::
VarType
::
BOOL
:
visitor
.
template
operator
()
<
bool
>();
break
;
default:
// PADDLE_THROW("Not supported");
printf
(
"Not supported"
);
}
}
inline
std
::
string
DataTypeToString
(
const
proto
::
VarType
::
Type
type
)
{
switch
(
type
)
{
case
proto
::
VarType
::
FP16
:
return
"float16"
;
case
proto
::
VarType
::
FP32
:
return
"float32"
;
case
proto
::
VarType
::
FP64
:
return
"float64"
;
case
proto
::
VarType
::
INT16
:
return
"int16"
;
case
proto
::
VarType
::
INT32
:
return
"int32"
;
case
proto
::
VarType
::
INT64
:
return
"int64"
;
case
proto
::
VarType
::
BOOL
:
return
"bool"
;
default:
// PADDLE_THROW("Not support type %d", type);
printf
(
"Not support type %d"
,
type
);
case
proto
::
VarType
::
FP16
:
return
"float16"
;
case
proto
::
VarType
::
FP32
:
return
"float32"
;
case
proto
::
VarType
::
FP64
:
return
"float64"
;
case
proto
::
VarType
::
INT16
:
return
"int16"
;
case
proto
::
VarType
::
INT32
:
return
"int32"
;
case
proto
::
VarType
::
INT64
:
return
"int64"
;
case
proto
::
VarType
::
BOOL
:
return
"bool"
;
default:
// PADDLE_THROW("Not support type %d", type);
printf
(
"Not support type %d"
,
type
);
}
}
...
...
@@ -120,5 +120,5 @@ inline std::ostream &operator<<(std::ostream &out,
return
out
;
}
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace framework
}
// namespace paddle_mobile
src/platform/macros.h
浏览文件 @
d2f8befa
...
...
@@ -16,10 +16,10 @@ limitations under the License. */
// Disable the copy and assignment operator for a class.
#ifndef DISABLE_COPY_AND_ASSIGN
#define DISABLE_COPY_AND_ASSIGN(classname) \
private:
\
classname(const classname
&) = delete;
\
classname(classname
&&) = delete;
\
classname
& operator=(const classname&) = delete;
\
classname
& operator=(classname
&&) = delete
#define DISABLE_COPY_AND_ASSIGN(classname)
\
private:
\
classname(const classname
&) = delete;
\
classname(classname
&&) = delete;
\
classname
&operator=(const classname &) = delete;
\
classname
&operator=(classname
&&) = delete
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录