From 7ff4408744701d57d72c64a06c14b2f2ca1ab758 Mon Sep 17 00:00:00 2001 From: huzhiqiang <912790387@qq.com> Date: Mon, 10 Feb 2020 11:09:22 +0800 Subject: [PATCH] [BUG FIX]fix armv7 model loading issue(#2836) --- lite/model_parser/naive_buffer/param_desc.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lite/model_parser/naive_buffer/param_desc.cc b/lite/model_parser/naive_buffer/param_desc.cc index cc97b02716..99d6552d46 100644 --- a/lite/model_parser/naive_buffer/param_desc.cc +++ b/lite/model_parser/naive_buffer/param_desc.cc @@ -152,10 +152,8 @@ void ParamDesc::SetDim(const std::vector& dim) { auto& data_builder = desc_->GetField>("data"); \ auto data = data_builder.data(); \ size_t size = data_builder.size() / sizeof(T); \ - auto* data_ptr = reinterpret_cast(data); \ - for (size_t i = 0; i < size; ++i) { \ - res.push_back(data_ptr[i]); \ - } \ + res.resize(size); \ + memcpy(&res[0], data, data_builder.size()); \ return res; \ } -- GitLab