From b2841ce8976fd1b99ca0ae1c5f7da805c280dbe2 Mon Sep 17 00:00:00 2001 From: tensor-tang Date: Wed, 12 Sep 2018 10:37:56 +0800 Subject: [PATCH] fix api fetch test=release/0.15.0 --- paddle/fluid/inference/api/api_impl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/fluid/inference/api/api_impl.cc b/paddle/fluid/inference/api/api_impl.cc index 960e8a07f5..49c352dcb8 100644 --- a/paddle/fluid/inference/api/api_impl.cc +++ b/paddle/fluid/inference/api/api_impl.cc @@ -275,7 +275,7 @@ bool NativePaddlePredictor::GetFetch( if (buffer.empty() || buffer.length() < sizeof(float) * data.size()) { buffer.Resize(sizeof(float) * data.size()); } - std::memcpy(buffer.data(), data.data(), buffer.length()); + std::memcpy(buffer.data(), data.data(), sizeof(float) * data.size()); // copy LoD for (const auto &level : fetchs[i].lod()) { outputs->at(i).lod.emplace_back(level); -- GitLab