From 16bed7e670b39e5c6416c3e13efdc69c91c7ac82 Mon Sep 17 00:00:00 2001 From: Kimish Patel Date: Thu, 26 Sep 2019 17:20:00 -0700 Subject: [PATCH] Exposed lowered func to c++ API. (#4012) So that you can use: `build_mod_.GetFunction("get_lowered_funcs", false);` to get lowered_funcs. Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: --- src/relay/backend/build_module.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/relay/backend/build_module.cc b/src/relay/backend/build_module.cc index 278ef43dd177..ef3ab723a28b 100644 --- a/src/relay/backend/build_module.cc +++ b/src/relay/backend/build_module.cc @@ -143,6 +143,10 @@ class RelayBuildModule : public runtime::ModuleNode { this->SetParam(kv.first, kv.second->data); } }); + } else if (name == "get_lowered_funcs") { + return PackedFunc([sptr_to_self, this](TVMArgs args, TVMRetValue* rv) { + *rv = this->graph_codegen_->GetLoweredFunc(); + }); } else { LOG(FATAL) << "Unknown packed function: " << name; return PackedFunc([sptr_to_self, name](TVMArgs args, TVMRetValue* rv) {});