Skip to content

Commit fc7e154

Browse files
committed
feat: fix nasa model bug
1 parent 5706e10 commit fc7e154

File tree

7 files changed

+11
-9
lines changed

7 files changed

+11
-9
lines changed

Diff for: examples/onnx_input_model/model_in.onnx

-48 Bytes
Binary file not shown.

Diff for: examples/onnx_input_model/model_out.onnx

-755 Bytes
Binary file not shown.

Diff for: examples/onnx_input_model/model_reg.onnx

-9 Bytes
Binary file not shown.

Diff for: examples/onnx_output_model/model_opted.onnx

-117 KB
Binary file not shown.

Diff for: examples/optimizer_c_example/optimize_example.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ int main(int argc, char* argv[]) {
2020
// std::string path1="../examples/onnx_input_model/model_lr.onnx";
2121
// std::string path2="../examples/onnx_input_model/model_linear.onnx";
2222

23-
std::string path1="../examples/onnx_input_model/model_nb.onnx";
24-
std::string path2="../examples/onnx_input_model/model_lr.onnx";
25-
std::string path3="../examples/onnx_input_model/model_sgd.onnx";
23+
std::string path1="../examples/onnx_input_model/neo_nb2.onnx";
24+
std::string path2="../examples/onnx_input_model/neo_lr2.onnx";
25+
std::string path3="../examples/onnx_input_model/neo_sgd2.onnx";
2626
// std::string pre1="model_lr_1_";
2727
// std::string pre2="model_linear_1_";
2828
std::string pre1="nb_1_";

Diff for: examples/optimizer_c_example/redundant.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ int main(int argc, char* argv[]) {
2222
std::string path13="../examples/onnx_input_model/model_reg.onnx";
2323
std::string pre="sgd_1_";
2424
std::string path_pre="../examples/onnx_input_model/model_reg_prefix.onnx";
25-
add_prefix_on_model(path13, path_pre, pre);
26-
std::vector<std::string> tmp = check_redundant(path_pre,path12);
27-
change_models(path_pre,outpath,inpath,tmp);
28-
25+
//add_prefix_on_model(path13, path_pre, pre);
26+
//std::vector<std::string> tmp = check_redundant(path_pre,path12);
27+
std::vector<std::string> tmp = check_redundant(path13,path6);
28+
//change_models(path_pre,outpath,inpath,tmp);
29+
change_models(path13,outpath,inpath,tmp);
2930
}

Diff for: onnxoptimizer/query_c_api/predicate_push_down.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ void merge_single_model_with_predicate(std::string& onnx_model_path, std::string
100100
*onnx_model.mutable_graph()->add_node()=reshape_node;
101101
*onnx_model.mutable_graph()->add_input()=input;
102102
*onnx_model.mutable_graph()->add_node()=node;
103-
std::regex pattern_output_label("_output_label$");
103+
std::regex pattern_output_label("_label$");
104104
std::vector<onnx::ValueInfoProto> output_list;
105105
std::vector<onnx::ValueInfoProto> save_output_list;
106106
for(int i=0;i<onnx_model.graph().output_size();i++){
@@ -175,10 +175,11 @@ void merge_double_models_with_predicate(std::string& onnx_model_path,std::string
175175

176176
// change onnx_model
177177
*onnx_model.mutable_graph()->add_node()=node;
178-
std::regex pattern_output_label("_output_label$");
178+
std::regex pattern_output_label("_label$");
179179
std::vector<onnx::ValueInfoProto> output_list;
180180
std::vector<onnx::ValueInfoProto> save_output_list;
181181
for(int i=0;i<onnx_model.graph().output_size();i++){
182+
std::string tmp=onnx_model.graph().output(i).name();
182183
if(!std::regex_search(onnx_model.graph().output(i).name(), pattern_l) &&
183184
!std::regex_search(onnx_model.graph().output(i).name(), pattern_r)){
184185
output_list.push_back(onnx_model.graph().output(i));

0 commit comments

Comments
 (0)