Class ov::frontend::FrontEnd

class FrontEnd

An interface for identifying a frontend for a particular framework. Provides an ability to load and convert of input model.

Public Functions

FrontEnd()

Default constructor.

template<typename ...Types>
inline bool supported(const Types&... vars) const

Validates if FrontEnd can recognize model with parameters specified. Same parameters should be used to load model.

Parameters

varsAny number of parameters of any type. What kind of parameters are accepted is determined by each FrontEnd individually, typically it is std::string containing path to the model file. For more information please refer to specific FrontEnd documentation.

Returns

true if model recognized, false - otherwise.

template<typename ...Types>
inline InputModel::Ptr load(const Types&... vars) const

Loads an input model by any specified arguments. Each FrontEnd separately defines what arguments it can accept.

Parameters

varsAny number of parameters of any type. What kind of parameters are accepted is determined by each FrontEnd individually, typically it is std::string containing path to the model file. For more information please refer to specific FrontEnd documentation.

Returns

Loaded input model.

virtual std::shared_ptr<ov::Model> convert(const InputModel::Ptr &model) const

Completely convert and normalize entire Model, throws if it is not possible.

Parameters

modelInput model

Returns

fully converted OV Model

virtual void convert(const std::shared_ptr<ov::Model> &partially_converted) const

Completely convert the remaining, not converted part of a Model.

Parameters

partiallyConverted – partially converted OV Model

virtual std::shared_ptr<ov::Model> convert_partially(const InputModel::Ptr &model) const

Convert only those parts of the model that can be converted leaving others as-is wrapped by FrameworkNode. Converted parts are normalized by additional transformations like it is done in convert method. If part of the graph cannot be converted, it is not guaranteed that the converted regions are completely normalized. Normalize should be called for each completely converted parts individually in this case.

Parameters

modelInput model

Returns

partially converted OV Model

virtual std::shared_ptr<ov::Model> decode(const InputModel::Ptr &model) const

Convert operations with one-to-one mapping with decoding nodes. Each decoding node is an OV node representing a single FW operation node with all attributes represented in FW-independent way.

Parameters

modelInput model

Returns

OV Model after decoding

virtual void normalize(const std::shared_ptr<ov::Model> &model) const

Runs normalization passes on Model that was loaded with partial conversion.

Parameters

Model – partially converted OV Model

virtual std::string get_name() const

Gets name of this FrontEnd. Can be used by clients if frontend is selected automatically by FrontEndManager::load_by_model.

Returns

Current frontend name. Empty string if not implemented

virtual void add_extension(const std::shared_ptr<ov::Extension> &extension)

Register base extension in the FrontEnd.

Parameters

extension – base extension

void add_extension(const std::vector<std::shared_ptr<ov::Extension>> &extensions)

Register base extensions in the FrontEnd.

Parameters

extensions – vector of extensions

void add_extension(const std::string &library_path)

Registers extension.

Parameters

library_path – path to library with ov::Extension

template<class T, typename std::enable_if<std::is_base_of<ov::Extension, T>::value, bool>::type = true>
inline void add_extension(const T &extension)

Registers extension.

Parameters

extensionExtension class which is inherited from ov::BaseOpExtension class

template<class T, class ...Targs, typename std::enable_if<std::is_base_of<ov::Extension, T>::value, bool>::type = true>
inline void add_extension(const T &extension, Targs... args)

Registers extensions.

Parameters

extensionExtension class which is inherited from ov::Extension class