Fix TRT custom op issue (#12283)

* Pass schema registry on CreateModel.

* Fix ORT_MINIMAL_BUILD.

* Fix build issue.
This commit is contained in:
Yateng Hong 2022-07-29 18:39:56 +08:00 committed by GitHub
parent 6514069749
commit c579497134
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -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);

View file

@ -743,7 +743,11 @@ struct ProviderHostImpl : ProviderHost {
void GraphViewer__operator_delete(GraphViewer* p) override { delete p; }
std::unique_ptr<Model> GraphViewer__CreateModel(const GraphViewer* graph_viewer, const logging::Logger& logger) override {
return std::make_unique<Model>(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<ONNX_NAMESPACE::FunctionProto>(), logger);
}