class ov::frontend::DecoderTransformationExtension

Overview

Holds a transformation that is applied just after the original model graph is decoded. This class is a holder for transformation. The transformation can be specified as FunctionPass or MathcerPass derivatives or as a function that can be used to build corresponding FunctionPass or MatcherPass object. The type of the extension is determined in the moment of creation by calling corresponding ctor. More…

#include <decoder_transformation.hpp>

class DecoderTransformationExtension: public ov::Extension
{
public:
    // typedefs

    typedef std::shared_ptr<DecoderTransformationExtension> Ptr;

    // construction

    DecoderTransformationExtension();
    DecoderTransformationExtension(const std::function<bool(std::shared_ptr<ov::Model>)>& function_pass);
    DecoderTransformationExtension(const std::function<void(ov::pass::MatcherPass \*)>& matcher_pass_initializer);

    template <
        typename Transformation,
        typename std::enable_if<std::is_base_of<ov::pass::PassBase, Transformation>::value, bool>::type = true
        >
    DecoderTransformationExtension(const Transformation& transformation);

    // methods

    void register_pass(ov::pass::Manager& manager) const;
};

Inherited Members

public:
    // typedefs

    typedef std::shared_ptr<Extension> Ptr;

Detailed Documentation

Holds a transformation that is applied just after the original model graph is decoded. This class is a holder for transformation. The transformation can be specified as FunctionPass or MathcerPass derivatives or as a function that can be used to build corresponding FunctionPass or MatcherPass object. The type of the extension is determined in the moment of creation by calling corresponding ctor.

Construction

DecoderTransformationExtension(const std::function<bool(std::shared_ptr<ov::Model>)>& function_pass)

Create a custom functional pass where code of the pass is implemented as a function.

DecoderTransformationExtension(const std::function<void(ov::pass::MatcherPass \*)>& matcher_pass_initializer)

Create a custom matcher pass where the code of matcher pass initialization is a given function.

template <
    typename Transformation,
    typename std::enable_if<std::is_base_of<ov::pass::PassBase, Transformation>::value, bool>::type = true
    >
DecoderTransformationExtension(const Transformation& transformation)

Register existing transformation object which will be copied and kept for further registration.

Methods

void register_pass(ov::pass::Manager& manager) const

Register pass from this object in a given pass manager object.