diff --git a/include/onnxruntime/core/graph/graph_viewer.h b/include/onnxruntime/core/graph/graph_viewer.h index 4e6b190c35..ca121adb9f 100644 --- a/include/onnxruntime/core/graph/graph_viewer.h +++ b/include/onnxruntime/core/graph/graph_viewer.h @@ -187,6 +187,10 @@ class GraphViewer { */ const IndexedSubGraph* GetFilterInfo() const { return filter_info_; } +#if !defined(ORT_MINIMAL_BUILD) + IOnnxRuntimeOpSchemaCollectionPtr GetSchemaRegistry() const { return graph_->GetSchemaRegistry(); } +#endif + private: ORT_DISALLOW_COPY_ASSIGNMENT_AND_MOVE(GraphViewer); GraphViewer(const Graph& graph, const IndexedSubGraph* filter_info); diff --git a/onnxruntime/core/session/provider_bridge_ort.cc b/onnxruntime/core/session/provider_bridge_ort.cc index 4ad8c31fea..fd35f57877 100644 --- a/onnxruntime/core/session/provider_bridge_ort.cc +++ b/onnxruntime/core/session/provider_bridge_ort.cc @@ -743,7 +743,11 @@ struct ProviderHostImpl : ProviderHost { void GraphViewer__operator_delete(GraphViewer* p) override { delete p; } std::unique_ptr GraphViewer__CreateModel(const GraphViewer* graph_viewer, const logging::Logger& logger) override { return std::make_unique(graph_viewer->Name(), true, ModelMetaData(), PathString(), +#if !defined(ORT_MINIMAL_BUILD) + IOnnxRuntimeOpSchemaRegistryList({graph_viewer->GetSchemaRegistry()}), graph_viewer->DomainToVersionMap(), +#else IOnnxRuntimeOpSchemaRegistryList(), graph_viewer->DomainToVersionMap(), +#endif // ORT_MINIMAL_BUILD std::vector(), logger); }