Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
5080f33b
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看板
提交
5080f33b
编写于
8月 31, 2021
作者:
S
ShiningZhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add comment for client
上级
e8f31562
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
1 deletion
+10
-1
core/general-client/include/brpc_client.h
core/general-client/include/brpc_client.h
+1
-0
core/general-client/include/client.h
core/general-client/include/client.h
+8
-0
core/general-client/src/client.cpp
core/general-client/src/client.cpp
+1
-1
未找到文件。
core/general-client/include/brpc_client.h
浏览文件 @
5080f33b
...
...
@@ -37,6 +37,7 @@ class ServingBrpcClient : public ServingClient {
const
uint64_t
log_id
);
private:
// generate default SDKConf
std
::
string
gen_desc
(
const
std
::
string
server_port
);
private:
...
...
core/general-client/include/client.h
浏览文件 @
5080f33b
...
...
@@ -143,6 +143,7 @@ class PredictorData {
std
::
string
print
();
private:
// used to print vector data map e.g. _float_data_map
template
<
typename
T1
,
typename
T2
>
std
::
string
map2string
(
const
std
::
map
<
T1
,
std
::
vector
<
T2
>>&
map
)
{
std
::
ostringstream
oss
;
...
...
@@ -171,6 +172,7 @@ class PredictorData {
return
oss
.
str
();
};
// used to print data map without vector e.g. _string_data_map
template
<
typename
T1
,
typename
T2
>
std
::
string
map2string
(
const
std
::
map
<
T1
,
T2
>&
map
)
{
std
::
ostringstream
oss
;
...
...
@@ -203,6 +205,9 @@ class PredictorInputs : public PredictorData {
PredictorInputs
()
{};
virtual
~
PredictorInputs
()
{};
// generate proto from inputs
// feed_name_to_idx: mapping alias name to idx
// feed_name: mapping idx to name
static
int
GenProto
(
const
PredictorInputs
&
inputs
,
const
std
::
map
<
std
::
string
,
int
>&
feed_name_to_idx
,
const
std
::
vector
<
std
::
string
>&
feed_name
,
...
...
@@ -235,6 +240,9 @@ class PredictorOutputs {
void
clear
();
// Parse proto to outputs
// fetch_name: name of data to be output
// fetch_name_to_type: mapping of fetch_name to datatype
static
int
ParseProto
(
const
predictor
::
general_model
::
Response
&
res
,
const
std
::
vector
<
std
::
string
>&
fetch_name
,
std
::
map
<
std
::
string
,
int
>&
fetch_name_to_type
,
...
...
core/general-client/src/client.cpp
浏览文件 @
5080f33b
...
...
@@ -386,7 +386,7 @@ int PredictorOutputs::ParseProto(const Response& res,
for
(
auto
&
name
:
fetch_name
)
{
// int idx = _fetch_name_to_idx[name];
if
(
fetch_name_to_type
[
name
]
==
P_INT64
)
{
VLOG
(
2
)
<<
"fe
r
ch var "
<<
name
<<
"type int64"
;
VLOG
(
2
)
<<
"fe
t
ch var "
<<
name
<<
"type int64"
;
int
size
=
output
.
tensor
(
idx
).
int64_data_size
();
int64_data_map
[
name
]
=
std
::
vector
<
int64_t
>
(
output
.
tensor
(
idx
).
int64_data
().
begin
(),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录