Enable Pruning transformation by default inside Model Optimizer (#5633)

This commit is contained in:
Gleb Kazantaev 2021-05-18 12:48:01 +03:00 committed by GitHub
parent b835c6e60a
commit 8be740a5aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -5,10 +5,16 @@
#include <memory>
#include "moc_transformations.hpp"
#include "pruning.hpp"
#include <ngraph/pass/manager.hpp>
NGRAPH_RTTI_DEFINITION(ngraph::pass::MOCTransformations, "MOCTransformations", 0);
bool ngraph::pass::MOCTransformations::run_on_function(std::shared_ptr<ngraph::Function>) {
bool ngraph::pass::MOCTransformations::run_on_function(std::shared_ptr<ngraph::Function> f) {
ngraph::pass::Manager m(get_pass_config());
m.register_pass<Pruning>();
m.run_passes(f);
return false;
}

View File

@ -35,6 +35,7 @@ def apply_offline_transformations(input_model: str, framework: str, transforms:
available_transformations[name](net, **args)
ApplyMOCTransformations(net, False)
net.serialize(input_model + ".xml", input_model + ".bin")
path_to_mapping = input_model + ".mapping"
GenerateMappingFile(net, path_to_mapping.encode('utf-8'), extract_names)