From 9920a06cc6a4a8987b85cd2ad0d0898c74a2bacf Mon Sep 17 00:00:00 2001 From: Helin Wang Date: Wed, 17 May 2017 20:32:40 -0400 Subject: [PATCH] rename local variable --- paddle/go/pserver/optimizer.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/paddle/go/pserver/optimizer.c b/paddle/go/pserver/optimizer.c index 36a612a56..8d63089b4 100644 --- a/paddle/go/pserver/optimizer.c +++ b/paddle/go/pserver/optimizer.c @@ -36,11 +36,11 @@ void release_SGD(void *optimizer) { } paddle_optimizer* paddle_create_SGD_optimizer(double learning_rate) { - SGD_optimizer* o = (SGD_optimizer*)malloc(sizeof(SGD_optimizer)); - o->learning_rate = learning_rate; - paddle_optimizer* container = (paddle_optimizer*)malloc(sizeof(paddle_optimizer)); - container->update = update_SGD; - container->release = release_SGD; - container->optimizer = o; - return container; + SGD_optimizer* impl = (SGD_optimizer*)malloc(sizeof(SGD_optimizer)); + impl->learning_rate = learning_rate; + paddle_optimizer* opt = (paddle_optimizer*)malloc(sizeof(paddle_optimizer)); + opt->update = update_SGD; + opt->release = release_SGD; + opt->optimizer = impl; + return opt; } -- GitLab