未验证 提交 3ddd9ed4 编写于 作者: H huzhiqiang 提交者: GitHub

[model parser] update model_parser to adapt for probuf of high version (#3314)

上级 5fdbfa3c
...@@ -382,7 +382,7 @@ void TensorToStream(std::ostream &os, const lite::Tensor &tensor) { ...@@ -382,7 +382,7 @@ void TensorToStream(std::ostream &os, const lite::Tensor &tensor) {
pb_dims->Resize(static_cast<int>(dims.size()), 0); pb_dims->Resize(static_cast<int>(dims.size()), 0);
auto dims_vec = dims.Vectorize(); auto dims_vec = dims.Vectorize();
std::copy(dims_vec.begin(), dims_vec.end(), pb_dims->begin()); 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<const char *>(&size), sizeof(size)); os.write(reinterpret_cast<const char *>(&size), sizeof(size));
auto out = desc.SerializeAsString(); auto out = desc.SerializeAsString();
os.write(out.data(), size); os.write(out.data(), size);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册