class ov::pass::Manager

Overview

Manager class allows to manage transformation passes. More…

#include <manager.hpp>

class Manager
{
public:
    // construction

    Manager();
    Manager(std::shared_ptr<PassConfig> pass_config);

    // methods

    template <typename T, bool Enable = true, class... Args>
    std::shared_ptr<T> register_pass(Args&&... args);

    std::shared_ptr<PassBase> register_pass_instance(std::shared_ptr<PassBase> pass);
    bool run_passes(std::shared_ptr<Model> model);
    void set_pass_visualization(bool new_state);
    void set_per_pass_validation(bool new_state);
    std::shared_ptr<PassConfig> get_pass_config();
};

Detailed Documentation

Manager class allows to manage transformation passes.

Methods

template <typename T, bool Enable = true, class... Args>
std::shared_ptr<T> register_pass(Args&&... args)

Register given transformation class type to execution list Example below show the basic usage of pass::Manager.

pass::Manager manager;
manager.register_pass<MyTransformation>(/\*transformation constructor ars\*&zwj;/);
manager.run_passes(f);

For some purposes transformation can be registered and disabled by default.

manager.register_pass<MyTransformation, false>();

Returns:

shared_ptr to the transformation instance

bool run_passes(std::shared_ptr<Model> model)

Runs registered transformations on a given model.

Parameters:

model

Input model

Returns:

Returns true if the model was changed by transformations, false otherwise.

void set_per_pass_validation(bool new_state)

Set flag to enable/disable running Validate pass after executing each registered pass.

Parameters:

new_state

Value “true” enables Validate pass run; “false”, otherwise

std::shared_ptr<PassConfig> get_pass_config()

Returns:

PassConfig shared object. This object is used for transformations pipeline configuration. This object allows to disable/enable transformations execution, set callback to particular transformation. For mo details see PassConfig class.