Skip to content

Conversation

ranqiu92
Copy link
Contributor

No description provided.

@ranqiu92 ranqiu92 requested a review from lcy-seso September 27, 2017 03:25
@lcy-seso lcy-seso requested a review from Xreki October 9, 2017 03:00
fprintf(stderr, "Open %s error\n", filename);
return NULL;
}
fseek(file, 0L, SEEK_END);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. 取文件大小可以用stat等函数,其实不用fseek两次
  2. 从这里开始的函数都没有判断返回值。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

CHECK(paddle_init(1, (char**)argv));

// Reading config binary file. It is generated by `convert_protobin.sh`
long size;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要初始化

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

long size;
void* config_buf = read_config(CONFIG_BIN, &size);

const char* model_path = "./ctr_model";
Copy link
Contributor

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传入会更方便一些?

Copy link
Contributor Author

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要判断返回值。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

CHECK(paddle_gradient_machine_create_shared_param(
machine, config_buf, size, &thread_local_machine));
ctr[i] = paddle_arguments_create_none();
;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是多余的。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants