Skip to content

Commit

Permalink
"fix pre-commit hook failed"
Browse files Browse the repository at this point in the history
  • Loading branch information
dzhwinter committed Jul 3, 2017
1 parent 7228533 commit 99e22a8
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions go/pserver/cclient/test/test_cclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ void sendGrads(paddle_pserver_client c) {
"param_a", PADDLE_ELEMENT_TYPE_FLOAT32, grad_a, 2000};
paddle_gradient grad2 = {
"param_b", PADDLE_ELEMENT_TYPE_FLOAT32, grad_b, 3000};
paddle_gradient* grads[2] = {&grad1, &grad2};
paddle_gradient *grads[2] = {&grad1, &grad2};
if (paddle_send_grads(c, grads, 2)) {
fail();
}
Expand All @@ -39,23 +39,23 @@ void getParams(paddle_pserver_client c) {
param_b.content = content_b;
param_b.content_len = 3000;

paddle_parameter* params[2] = {&param_a, &param_b};
paddle_parameter *params[2] = {&param_a, &param_b};
if (paddle_get_params(c, params, 2)) {
fail();
}
}



int main() {
char addr[] = "localhost:3000";
paddle_pserver_client c = paddle_new_pserver_client(addr, 1);
char *config_proto;
size_t config_proto_len = 0;
ssize_t nread;
FILE *fp = fopen("testdata/optimizer.pb.txt", "r");
if(!fp) { fail(); }
while((nread = getline(&config_proto, &config_proto_len, fp)) != -1) {
if (!fp) {
fail();
}
while ((nread = getline(&config_proto, &config_proto_len, fp)) != -1) {
printf("%s", config_proto);
}
fclose(fp);
Expand All @@ -70,7 +70,8 @@ int main() {
param.name = name_a;
param.content = content_a;
param.content_len = 2000;
int error = paddle_init_param(c, param, (void *)config_proto, config_proto_len);
int error =
paddle_init_param(c, param, (void *)config_proto, config_proto_len);
if (error != 0) {
goto retry;
}
Expand Down

0 comments on commit 99e22a8

Please sign in to comment.