From 3ddd9ed46de2f8d1a1b98fae2873afbf533fd89f Mon Sep 17 00:00:00 2001 From: huzhiqiang <912790387@qq.com> Date: Fri, 3 Apr 2020 15:14:45 +0800 Subject: [PATCH] [model parser] update model_parser to adapt for probuf of high version (#3314) --- lite/model_parser/model_parser.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lite/model_parser/model_parser.cc b/lite/model_parser/model_parser.cc index 08e6a30309..7f938577c3 100644 --- a/lite/model_parser/model_parser.cc +++ b/lite/model_parser/model_parser.cc @@ -382,7 +382,7 @@ void TensorToStream(std::ostream &os, const lite::Tensor &tensor) { pb_dims->Resize(static_cast(dims.size()), 0); auto dims_vec = dims.Vectorize(); std::copy(dims_vec.begin(), dims_vec.end(), pb_dims->begin()); - int32_t size = desc.ByteSize(); + int32_t size = desc.ByteSizeLong(); os.write(reinterpret_cast(&size), sizeof(size)); auto out = desc.SerializeAsString(); os.write(out.data(), size); -- GitLab