Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
de94d06e
S
Serving
项目概览
PaddlePaddle
/
Serving
接近 2 年 前同步成功
通知
186
Star
833
Fork
253
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
105
列表
看板
标记
里程碑
合并请求
10
Wiki
2
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Serving
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
105
Issue
105
列表
看板
标记
里程碑
合并请求
10
合并请求
10
Pages
分析
分析
仓库分析
DevOps
Wiki
2
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
de94d06e
编写于
3月 10, 2021
作者:
H
HexToString
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix again
上级
bf9b60f2
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
6 addition
and
6 deletion
+6
-6
core/predictor/framework/infer.h
core/predictor/framework/infer.h
+6
-6
未找到文件。
core/predictor/framework/infer.h
浏览文件 @
de94d06e
...
...
@@ -602,13 +602,13 @@ class FluidInferEngine : public CloneDBReloadableInferEngine<FluidFamilyCore> {
}
//set inputHandle
BatchTensor
*
batchTensor_pointer_in
=
reinterpret_cast
<
const
BatchTensor
*>
(
in
);
const
BatchTensor
*
batchTensor_pointer_in
=
reinterpret_cast
<
const
BatchTensor
*>
(
in
);
for
(
int
i
=
0
;
i
<
batchTensor_pointer_in
->
count
();
++
i
){
Tensor
tensor_in_batchTensor
=
(
*
batchTensor_pointer_in
)[
i
];
auto
lod_tensor_in
=
core
.
GetInputHandle
(
tensor_in_batchTensor
.
name
);
auto
lod_tensor_in
=
core
->
GetInputHandle
(
tensor_in_batchTensor
.
name
);
lod_tensor_in
->
SetLoD
(
tensor_in_batchTensor
.
lod
);
lod_tensor_in
->
Reshape
(
tensor_in_batchTensor
.
shape
);
void
*
origin_data
=
tensor_in_batchTensor
.
data
()
.
data
();
void
*
origin_data
=
tensor_in_batchTensor
.
data
.
data
();
if
(
tensor_in_batchTensor
.
type
==
FLOAT32
){
float
*
data
=
reinterpret_cast
<
float
*>
(
origin_data
);
lod_tensor_in
->
CopyFromCpu
(
data
);
...
...
@@ -627,9 +627,9 @@ class FluidInferEngine : public CloneDBReloadableInferEngine<FluidFamilyCore> {
//get out and copy to void* out
BatchTensor
*
batchTensor_pointer_out
=
reinterpret_cast
<
BatchTensor
*>
(
out
);
std
::
vector
<
std
::
string
>
outnames
=
core
.
GetOutputNames
();
std
::
vector
<
std
::
string
>
outnames
=
core
->
GetOutputNames
();
for
(
int
i
=
0
;
i
<
outnames
.
size
();
++
i
){
auto
lod_tensor_out
=
core
.
GetOutputHandle
(
outnames
[
i
]);
auto
lod_tensor_out
=
core
->
GetOutputHandle
(
outnames
[
i
]);
std
::
vector
<
int
>
output_shape
=
lod_tensor_out
->
shape
();
int
out_num
=
std
::
accumulate
(
output_shape
.
begin
(),
output_shape
.
end
(),
1
,
std
::
multiplies
<
int
>
());
int
dataType
=
lod_tensor_out
->
type
();
...
...
@@ -653,7 +653,7 @@ class FluidInferEngine : public CloneDBReloadableInferEngine<FluidFamilyCore> {
}
Tensor
tensor_out
;
tensor_out
.
name
=
outnames
[
i
];
tensor_out
.
type
=
dataType
;
tensor_out
.
type
=
DataType
(
dataType
)
;
tensor_out
.
shape
.
assign
(
output_shape
.
begin
(),
output_shape
.
end
());
std
::
vector
<
std
::
vector
<
size_t
>>
out_lod
=
lod_tensor_out
->
lod
();
for
(
int
li
=
0
;
li
<
out_lod
.
size
();
++
li
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录