From e7cd10b9da47d79306f52c2236060bb0a9ccb290 Mon Sep 17 00:00:00 2001 From: Tomasz Dolbniak Date: Thu, 23 Jan 2025 20:10:28 +0100 Subject: [PATCH] [mir] Adapt to the Protobuf API changes This commit adapts the code in mir to the changes in the Protobuf API. This is a backport of https://github.com/Samsung/ONE/pull/14572 to the release branch --- compiler/mir/src/mir_caffe2_importer/caffe2_importer.cpp | 2 +- compiler/mir/src/mir_caffe_importer/caffe_importer.cpp | 2 +- compiler/mir/src/mir_onnx_importer/ONNXImporterImpl.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/mir/src/mir_caffe2_importer/caffe2_importer.cpp b/compiler/mir/src/mir_caffe2_importer/caffe2_importer.cpp index abecfc88a00..a6563375e07 100644 --- a/compiler/mir/src/mir_caffe2_importer/caffe2_importer.cpp +++ b/compiler/mir/src/mir_caffe2_importer/caffe2_importer.cpp @@ -124,7 +124,7 @@ static void loadModelFile(const std::string &filename, caffe2::NetDef *net) file_stream.SetCloseOnDelete(true); google::protobuf::io::CodedInputStream coded_stream(&file_stream); - coded_stream.SetTotalBytesLimit(INT_MAX, INT_MAX); + coded_stream.SetTotalBytesLimit(INT_MAX); if (!net->ParseFromCodedStream(&coded_stream)) throw std::runtime_error("Couldn't parse file \"" + filename + "\"."); diff --git a/compiler/mir/src/mir_caffe_importer/caffe_importer.cpp b/compiler/mir/src/mir_caffe_importer/caffe_importer.cpp index c7465829921..0fb7670c5e9 100644 --- a/compiler/mir/src/mir_caffe_importer/caffe_importer.cpp +++ b/compiler/mir/src/mir_caffe_importer/caffe_importer.cpp @@ -106,7 +106,7 @@ void loadModelFromBinaryFile(const std::string &filename, caffe::NetParameter *n file_stream.SetCloseOnDelete(true); google::protobuf::io::CodedInputStream coded_stream(&file_stream); - coded_stream.SetTotalBytesLimit(INT_MAX, INT_MAX); + coded_stream.SetTotalBytesLimit(INT_MAX); if (!net->ParseFromCodedStream(&coded_stream)) throw std::runtime_error("Couldn't parse file \"" + filename + "\"."); diff --git a/compiler/mir/src/mir_onnx_importer/ONNXImporterImpl.cpp b/compiler/mir/src/mir_onnx_importer/ONNXImporterImpl.cpp index 6379b6c87d6..fc2a3f0b847 100644 --- a/compiler/mir/src/mir_onnx_importer/ONNXImporterImpl.cpp +++ b/compiler/mir/src/mir_onnx_importer/ONNXImporterImpl.cpp @@ -77,7 +77,7 @@ void loadModelFromBinaryFile(const std::string &filename, onnx::ModelProto *mode file_stream.SetCloseOnDelete(true); google::protobuf::io::CodedInputStream coded_stream(&file_stream); - coded_stream.SetTotalBytesLimit(INT_MAX, INT_MAX); + coded_stream.SetTotalBytesLimit(INT_MAX); if (!model->ParseFromCodedStream(&coded_stream)) throw std::runtime_error("Couldn't parse file \"" + filename + "\".");