HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
onnxruntime::SchemaRegistryManager Class Reference

#include <schema_registry.h>

+ Inheritance diagram for onnxruntime::SchemaRegistryManager:

Public Member Functions

void RegisterRegistry (std::shared_ptr< IOnnxRuntimeOpSchemaCollection > registry)
 
DomainToVersionMap GetLatestOpsetVersions (bool is_onnx_only) const override
 
DomainToVersionMap GetLastReleasedOpsetVersions (bool is_onnx_only) const
 
void GetSchemaAndHistory (const std::string &key, int max_inclusive_version, const std::string &domain, const ONNX_NAMESPACE::OpSchema **latest_schema, int *earliest_opset_where_unchanged) const override
 
- Public Member Functions inherited from onnxruntime::IOnnxRuntimeOpSchemaCollection
const ONNX_NAMESPACE::OpSchema * GetSchema (const std::string &key, const int maxInclusiveVersion, const std::string &domain) const final
 

Detailed Description

SchemaRegistryManager provides a view based on built-in ONNX schema and a list of OnnxRuntimeOpSchemaRegistry as supplement.

The user needs to make sure the customized schema registry is valid, otherwise the behavior is undefined.

Todo:
We may add more consistency checks later.

Definition at line 123 of file schema_registry.h.

Member Function Documentation

DomainToVersionMap onnxruntime::SchemaRegistryManager::GetLastReleasedOpsetVersions ( bool  is_onnx_only) const

Gets the last released opset versions.

Parameters
is_onnx_onlyIf true, return ONNX schemas only. If false, return the schemas for all domains.
DomainToVersionMap onnxruntime::SchemaRegistryManager::GetLatestOpsetVersions ( bool  is_onnx_only) const
overridevirtual

Gets the latest opset versions.

Parameters
is_onnx_onlyIf true, return the latest ONNX schemas. If false, return the latest schemas for all domains.

Implements onnxruntime::IOnnxRuntimeOpSchemaCollection.

void onnxruntime::SchemaRegistryManager::GetSchemaAndHistory ( const std::string key,
int  max_inclusive_version,
const std::string domain,
const ONNX_NAMESPACE::OpSchema **  latest_schema,
int earliest_opset_where_unchanged 
) const
overridevirtual

Gets the OpSchema and its history. Searches custom schema registries starting with the last one added. \ If the OpSchema is not found the default ONNX schema registry is searched.

Parameters
keyOperator type.
max_inclusive_versionMaximum opset version allowed, inclusive.
domainThe domain of the operator.
[out]latest_schemaReturns the latest OpSchema if found. nullptr otherwise.
[out]earliest_opset_where_unchangedThe earliest opset version preceding max_inclusive_version where the operator is known to be unchanged.

Implements onnxruntime::IOnnxRuntimeOpSchemaCollection.

void onnxruntime::SchemaRegistryManager::RegisterRegistry ( std::shared_ptr< IOnnxRuntimeOpSchemaCollection registry)

Register a new schema registry instance.

Remarks
The schema registry priority is the reverse of registration order. i.e. the last registry added will be searched first for a matching OpSchema.

The documentation for this class was generated from the following file: