10 #include "core/graph/onnx_protobuf.h"
11 #include "onnx/defs/schema.h"
17 namespace onnxruntime {
20 std::unordered_map<std::string, std::map<ONNX_NAMESPACE::OperatorSetVersion, ONNX_NAMESPACE::OpSchema>>>;
39 using ISchemaRegistry::GetSchema;
43 const ONNX_NAMESPACE::OpSchema* latest_schema =
nullptr;
45 GetSchemaAndHistory(key, maxInclusiveVersion, domain, &latest_schema, &earliest_opset_where_unchanged);
47 assert(latest_schema ==
nullptr || (latest_schema->SinceVersion() <= maxInclusiveVersion &&
48 earliest_opset_where_unchanged == latest_schema->SinceVersion()));
55 int maxInclusiveVersion,
57 const ONNX_NAMESPACE::OpSchema** latest_schema,
58 int* earliest_opset_where_unchanged)
const = 0;
78 int baseline_opset_version,
85 std::vector<ONNX_NAMESPACE::OpSchema>& schemas,
87 int baseline_opset_version,
93 const ONNX_NAMESPACE::OpSchema** latest_schema,
94 int* earliest_opset_where_unchanged)
const override;
101 common::Status RegisterOpSchema(ONNX_NAMESPACE::OpSchema&& op_schema);
103 common::Status RegisterOpSchemaInternal(ONNX_NAMESPACE::OpSchema&& op_schema);
128 void RegisterRegistry(std::shared_ptr<IOnnxRuntimeOpSchemaCollection> registry);
152 const ONNX_NAMESPACE::OpSchema** latest_schema,
153 int* earliest_opset_where_unchanged)
const override;
156 void GetDomainToVersionMapForRegistries(
DomainToVersionMap& domain_version_map,
bool is_onnx_only)
const;
158 std::deque<std::shared_ptr<IOnnxRuntimeOpSchemaCollection>> registries;
void RegisterRegistry(std::shared_ptr< IOnnxRuntimeOpSchemaCollection > registry)
OnnxRuntimeOpSchemaRegistry()=default
const ONNX_NAMESPACE::OpSchema * GetSchema(const std::string &key, const int maxInclusiveVersion, const std::string &domain) const final
GLsizei const GLchar *const * string
common::Status SetBaselineAndOpsetVersionForDomain(const std::string &domain, int baseline_opset_version, int opset_version)
common::Status RegisterOpSet(std::vector< ONNX_NAMESPACE::OpSchema > &schemas, const std::string &domain, int baseline_opset_version, int opset_version)
DomainToVersionMap GetLatestOpsetVersions(bool is_onnx_only) const override
void GetSchemaAndHistory(const std::string &key, int maxInclusiveVersion, const std::string &domain, const ONNX_NAMESPACE::OpSchema **latest_schema, int *earliest_opset_where_unchanged) const override
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
DomainToVersionMap GetLastReleasedOpsetVersions(bool is_onnx_only) const
int baseline_opset_version
virtual DomainToVersionMap GetLatestOpsetVersions(bool is_onnx_only) const =0
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
std::unordered_map< std::string, std::unordered_map< std::string, std::map< ONNX_NAMESPACE::OperatorSetVersion, ONNX_NAMESPACE::OpSchema >>> OpName_Domain_Version_Schema_Map
std::unordered_map< std::string, SchemaRegistryVersion > DomainToVersionRangeMap
std::unordered_map< std::string, int > DomainToVersionMap
DomainToVersionMap GetLatestOpsetVersions(bool is_onnx_only) const override
virtual void GetSchemaAndHistory(const std::string &key, int maxInclusiveVersion, const std::string &domain, const ONNX_NAMESPACE::OpSchema **latest_schema, int *earliest_opset_where_unchanged) const =0