-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add capi for ctr #324
Add capi for ctr #324
Conversation
how_to_use_capi/common/common.h
Outdated
fprintf(stderr, "Open %s error\n", filename); | ||
return NULL; | ||
} | ||
fseek(file, 0L, SEEK_END); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 取文件大小可以用stat等函数,其实不用fseek两次
- 从这里开始的函数都没有判断返回值。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
how_to_use_capi/ctr/main.cpp
Outdated
CHECK(paddle_init(1, (char**)argv)); | ||
|
||
// Reading config binary file. It is generated by `convert_protobin.sh` | ||
long size; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
需要初始化
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
how_to_use_capi/ctr/main.cpp
Outdated
long size; | ||
void* config_buf = read_config(CONFIG_BIN, &size); | ||
|
||
const char* model_path = "./ctr_model"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
model_path和infer_data_path从commandline传入会更方便一些?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
vector<vector<float>> thread_lr_value; | ||
|
||
ifstream file; | ||
file.open(infer_data_path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
需要判断返回值。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
how_to_use_capi/ctr/main.cpp
Outdated
CHECK(paddle_gradient_machine_create_shared_param( | ||
machine, config_buf, size, &thread_local_machine)); | ||
ctr[i] = paddle_arguments_create_none(); | ||
; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个是多余的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gongweibao Done
No description provided.