From 413cbb8432255349d9152449597cb3b96d037495 Mon Sep 17 00:00:00 2001 From: Liang Zhao Date: Tue, 14 Feb 2017 16:58:41 -0800 Subject: [PATCH] fix a variable definition bug --- paddle/gserver/evaluators/Evaluator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/gserver/evaluators/Evaluator.cpp b/paddle/gserver/evaluators/Evaluator.cpp index 5fbba77b4..1c2479d72 100644 --- a/paddle/gserver/evaluators/Evaluator.cpp +++ b/paddle/gserver/evaluators/Evaluator.cpp @@ -96,14 +96,14 @@ public: int* ids = nullptr; int* lbl = nullptr; + IVectorPtr dest = IVector::create(maxIds_->getSize(), false); + IVectorPtr dest2 = IVector::create(label->getSize(), false); if (useGpu(arguments[0].deviceId)) { - IVectorPtr dest = IVector::create(maxIds_->getSize(), false); hl_memcpy_device2host((void*)dest->getData(), (void*)maxIds_->getData(), sizeof(int) * maxIds_->getSize()); ids = dest->getData(); - IVectorPtr dest2 = IVector::create(label->getSize(), false); hl_memcpy_device2host((void*)dest2->getData(), (void*)label->getData(), sizeof(int) * label->getSize()); -- GitLab