Skip to content

Commit

Permalink
[mir] Adapt to the Protobuf API changes
Browse files Browse the repository at this point in the history
This commit adapts the code in mir to the changes in the Protobuf API.

This is a backport of #14572 to the release branch
  • Loading branch information
tomdol committed Jan 23, 2025
1 parent 44fd15b commit e7cd10b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion compiler/mir/src/mir_caffe2_importer/caffe2_importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 + "\".");
Expand Down
2 changes: 1 addition & 1 deletion compiler/mir/src/mir_caffe_importer/caffe_importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 + "\".");
Expand Down
2 changes: 1 addition & 1 deletion compiler/mir/src/mir_onnx_importer/ONNXImporterImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 + "\".");
Expand Down

0 comments on commit e7cd10b

Please sign in to comment.