ONNX importer features namespace. Functions in this namespace make it possible to use ONNX models. More...
Data Structures | |
class | Node |
class | ONNXModelEditor |
A class representing a set of utilities allowing modification of an ONNX model. More... | |
Typedefs | |
using | Operator = std::function< OutputVector(const Node &)> |
Function which transforms single ONNX operator to nGraph sub-graph. | |
using | OperatorSet = std::unordered_map< std::string, std::reference_wrapper< const Operator > > |
Map which contains ONNX operators accessible by std::string value as a key. | |
Functions | |
std::ostream & | operator<< (std::ostream &outs, const Node &node) |
NGRAPH_HELPER_DLL_IMPORT std::set< std::string > | get_supported_operators (std::int64_t version, const std::string &domain) |
Returns a set of names of supported operators for the given opset version and domain. More... | |
NGRAPH_HELPER_DLL_IMPORT bool | is_operator_supported (const std::string &op_name, std::int64_t version, const std::string &domain="ai.onnx") |
Determines whether ONNX operator is supported. More... | |
NGRAPH_HELPER_DLL_IMPORT std::shared_ptr< Function > | import_onnx_model (std::istream &stream, const std::string &model_path="") |
Imports and converts an serialized ONNX model from the input stream to an nGraph Function representation. More... | |
NGRAPH_HELPER_DLL_IMPORT std::shared_ptr< Function > | import_onnx_model (const std::string &file_path) |
Imports and converts an ONNX model from the input file to an nGraph Function representation. More... | |
NGRAPH_HELPER_DLL_IMPORT std::shared_ptr< Function > | import_onnx_model (const ONNXModelEditor &model_editor) |
Imports an ONNX model modified by the ONNXModelEditor wrapper. More... | |
NGRAPH_HELPER_DLL_IMPORT void | register_operator (const std::string &name, std::int64_t version, const std::string &domain, Operator fn) |
Registers ONNX custom operator. The function performs the registration of external ONNX operator which is not part of ONNX importer. More... | |
NGRAPH_HELPER_DLL_IMPORT void | unregister_operator (const std::string &name, std::int64_t version, const std::string &domain) |
Unregisters ONNX custom operator. The function unregisters previously registered operator. More... | |
ONNX importer features namespace. Functions in this namespace make it possible to use ONNX models.
NGRAPH_HELPER_DLL_IMPORT std::set<std::string> ngraph::onnx_import::get_supported_operators | ( | std::int64_t | version, |
const std::string & | domain | ||
) |
Returns a set of names of supported operators for the given opset version and domain.
[in] | version | An opset version to get the supported operators for. |
[in] | domain | A domain to get the supported operators for. |
NGRAPH_HELPER_DLL_IMPORT std::shared_ptr<Function> ngraph::onnx_import::import_onnx_model | ( | const ONNXModelEditor & | model_editor | ) |
Imports an ONNX model modified by the ONNXModelEditor wrapper.
[in] | model_editor | Reference to the model editor object instance. |
NGRAPH_HELPER_DLL_IMPORT std::shared_ptr<Function> ngraph::onnx_import::import_onnx_model | ( | const std::string & | file_path | ) |
Imports and converts an ONNX model from the input file to an nGraph Function representation.
[in] | file_path | The path to a file containing the ONNX model (relative or absolute). |
NGRAPH_HELPER_DLL_IMPORT std::shared_ptr<Function> ngraph::onnx_import::import_onnx_model | ( | std::istream & | stream, |
const std::string & | model_path = "" |
||
) |
Imports and converts an serialized ONNX model from the input stream to an nGraph Function representation.
[in] | stream | The input stream (e.g. file stream, memory stream, etc). |
[in] | model_path | The path to the imported onnx model. It is required if the imported model uses data saved in external files. |
NGRAPH_HELPER_DLL_IMPORT bool ngraph::onnx_import::is_operator_supported | ( | const std::string & | op_name, |
std::int64_t | version, | ||
const std::string & | domain = "ai.onnx" |
||
) |
Determines whether ONNX operator is supported.
[in] | op_name | The ONNX operator name. |
[in] | version | The ONNX operator set version. |
[in] | domain | The domain the ONNX operator is registered to. If not set, the default domain "ai.onnx" is used. |
NGRAPH_HELPER_DLL_IMPORT void ngraph::onnx_import::register_operator | ( | const std::string & | name, |
std::int64_t | version, | ||
const std::string & | domain, | ||
Operator | fn | ||
) |
Registers ONNX custom operator. The function performs the registration of external ONNX operator which is not part of ONNX importer.
name | The ONNX operator name. |
version | The ONNX operator set version. |
domain | The domain the ONNX operator is registered to. |
fn | The function providing the implementation of the operator which transforms the single ONNX operator to an nGraph sub-graph. |
NGRAPH_HELPER_DLL_IMPORT void ngraph::onnx_import::unregister_operator | ( | const std::string & | name, |
std::int64_t | version, | ||
const std::string & | domain | ||
) |
Unregisters ONNX custom operator. The function unregisters previously registered operator.
name | The ONNX operator name. |
version | The ONNX operator set version. |
domain | The domain the ONNX operator is registered to. |