Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
bd59518f
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
331
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
271
列表
看板
标记
里程碑
合并请求
78
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle-Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
271
Issue
271
列表
看板
标记
里程碑
合并请求
78
合并请求
78
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
bd59518f
编写于
6月 05, 2018
作者:
L
liuruilong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
format files
上级
b67a4bc6
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
12 addition
and
16 deletion
+12
-16
src/common/protobuf-c.h
src/common/protobuf-c.h
+0
-1
src/framework/data_transform.h
src/framework/data_transform.h
+1
-1
src/framework/program/program-optimize/fusion_op_register.h
src/framework/program/program-optimize/fusion_op_register.h
+1
-1
src/io.cpp
src/io.cpp
+10
-13
未找到文件。
src/common/protobuf-c.h
浏览文件 @
bd59518f
...
...
@@ -877,7 +877,6 @@ PROTOBUF_C__API
void
protobuf_c_message_init
(
const
ProtobufCMessageDescriptor
*
descriptor
,
void
*
message
);
/**
* Initialise a `ProtobufCBufferSimple` object.
*/
...
...
src/framework/data_transform.h
浏览文件 @
bd59518f
...
...
@@ -18,9 +18,9 @@ limitations under the License. */
#include <utility>
#include <vector>
#include "framework/op_kernel_type.h"
#include "framework/tensor.h"
#include "framework/variable.h"
#include "framework/op_kernel_type.h"
namespace
paddle_mobile
{
namespace
framework
{
...
...
src/framework/program/program-optimize/fusion_op_register.h
浏览文件 @
bd59518f
...
...
@@ -17,8 +17,8 @@ limitations under the License. */
#include <map>
#include <string>
#include "node.h"
#include "framework/operator.h"
#include "node.h"
namespace
paddle_mobile
{
namespace
framework
{
...
...
src/io.cpp
浏览文件 @
bd59518f
...
...
@@ -17,28 +17,30 @@ limitations under the License. */
#include "common/log.h"
#include "common/enforce.h"
#include "framework/scope.h"
#include "framework/tensor.h"
#include "framework/operator.h"
#include "framework/lod_tensor.h"
#include "framework/framework.pb-c.h"
#include "framework/
program/var_desc
.h"
#include "framework/
program/program_desc
.h"
#include "framework/
lod_tensor
.h"
#include "framework/
operator
.h"
#include "framework/program/program-optimize/program_optimize.h"
#include "framework/program/program_desc.h"
#include "framework/program/var_desc.h"
#include "framework/scope.h"
#include "framework/tensor.h"
namespace
paddle_mobile
{
using
framework
::
Variable
;
char
*
Get_binary_data
(
std
::
string
filename
)
{
FILE
*
file
=
fopen
(
filename
.
c_str
(),
"rb"
);
PADDLE_MOBILE_ENFORCE
(
file
!=
nullptr
,
"can't open file: %s "
,
filename
.
c_str
());
PADDLE_MOBILE_ENFORCE
(
file
!=
nullptr
,
"can't open file: %s "
,
filename
.
c_str
());
fseek
(
file
,
0
,
SEEK_END
);
long
size
=
ftell
(
file
);
PADDLE_MOBILE_ENFORCE
(
size
>
0
,
"size is too small"
);
rewind
(
file
);
char
*
data
=
new
char
[
size
];
size_t
bytes_read
=
fread
(
data
,
1
,
size
,
file
);
PADDLE_MOBILE_ENFORCE
(
bytes_read
==
size
,
"read binary file bytes do not match with fseek"
);
PADDLE_MOBILE_ENFORCE
(
bytes_read
==
size
,
"read binary file bytes do not match with fseek"
);
fclose
(
file
);
return
data
;
}
...
...
@@ -84,7 +86,6 @@ void Loader<Dtype, P>::LoadVar(framework::Variable *variable,
auto
&
lod
=
*
tensor
->
mutable_lod
();
lod
.
resize
(
lod_level
);
for
(
uint64_t
i
=
0
;
i
<
lod_level
;
++
i
)
{
uint32_t
size
=
*
(
uint64_t
*
)
data
;
data
+=
sizeof
(
uint64_t
);
...
...
@@ -100,7 +101,6 @@ void Loader<Dtype, P>::LoadVar(framework::Variable *variable,
uint32_t
tensor_version
=
*
(
uint32_t
*
)
data
;
data
+=
sizeof
(
uint32_t
);
// 4. tensor desc
uint32_t
size
=
*
(
int32_t
*
)
data
;
data
+=
sizeof
(
int32_t
);
...
...
@@ -278,16 +278,13 @@ void Executor<Dtype, P>::LoadMemory(const framework::VarDesc var_desc,
data
+=
sizeof
(
uint64_t
);
DLOG
<<
"lod_level: "
<<
lod_level
;
auto
&
lod
=
*
tensor
->
mutable_lod
();
lod
.
resize
(
lod_level
);
for
(
uint64_t
i
=
0
;
i
<
lod_level
;
++
i
)
{
uint64_t
size
=
*
(
uint64_t
*
)
data
;
data
+=
sizeof
(
uint64_t
);
DLOG
<<
"lod size: "
<<
i
<<
size
;
std
::
vector
<
size_t
>
tmp
(
size
/
sizeof
(
size_t
));
for
(
int
k
=
0
;
k
<
tmp
.
size
();
++
k
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录