File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -46,12 +46,23 @@ struct Optimizer {
46
46
ModelProto mp_out = PrepareOutput (mp_in);
47
47
this ->pass_manager ->run (*g);
48
48
ExportModelProto (&mp_out, g);
49
+
50
+ // Maybe we can optimize these functions, now just copy
51
+ AddFunctionsToModel (mp_in, mp_out);
49
52
return mp_out;
50
53
}
51
54
52
55
private:
53
56
std::shared_ptr<PassManager> pass_manager;
54
57
58
+ void AddFunctionsToModel (const ModelProto &original_model,
59
+ ModelProto &output_model) {
60
+ for (const auto & function_proto : original_model.functions ()) {
61
+ auto * p_f = output_model.add_functions ();
62
+ p_f->CopyFrom (function_proto);
63
+ }
64
+ }
65
+
55
66
ModelProto AddInitializerToInput (const ModelProto &original_model) {
56
67
ModelProto model = original_model;
57
68
std::vector<std::string> input_names;
You can’t perform that action at this time.
0 commit comments