Skip to content

Commit

Permalink
Remove GetMainModule
Browse files Browse the repository at this point in the history
  • Loading branch information
electriclilies committed Sep 2, 2021
1 parent 87d5f64 commit e5e2516
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
17 changes: 0 additions & 17 deletions src/relay/backend/te_compiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -918,23 +918,6 @@ Map<Target, IRModule> GetPerTargetModules(IRModule mod) {
return per_target_modules;
}

IRModule GetMainModule(IRModule mod) {
IRModule main_module;
// Copy the type defs
for (const auto& kv : mod->type_definitions) {
main_module->AddTypeDef(kv.first, kv.second);
}
// Copy all Relay functions (we don't include PrimFuncs)
for (auto kv : mod->functions) {
const GlobalVar& var = kv.first;
const BaseFunc& func = kv.second;
if (func->IsInstance<tvm::relay::FunctionNode>()) {
main_module->Add(var, func);
}
}
return main_module;
}

Pass LowerTEPass(TargetMap targets, DeviceMap device_context_map,
backend::StaticMemoryPlan memory_plan, const String& module_name,
std::function<void(Function)> process_fn) {
Expand Down
7 changes: 0 additions & 7 deletions src/relay/backend/te_compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,6 @@ Target GetTargetFromInteger(DLDeviceType dev_type, TargetMap targets);
*/
Map<Target, IRModule> GetPerTargetModules(IRModule mod);

/*!
* \brief Utility to extract all the Relay functions from an IRModule, with no PrimFuncs.
* \param mod The IRModule to extract the Relay functions from
* \return An IRModule containing only the Relay functions that are in the input mod (no PrimFuncs)
*/
IRModule GetMainModule(IRModule mod);

/*! \brief Lower an IRModule's primitive functions to TIR.
*
* This is the "back half" of the Relay compiler which lowers "primitive functions"
Expand Down

0 comments on commit e5e2516

Please sign in to comment.