Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
MarisaKirisame committed Aug 21, 2020
1 parent 14e9c37 commit 27c6bdd
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/ir/module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,7 @@ void IRModuleNode::Update(const IRModule& mod) {
}
}

IRModule IRModule::FromFunc(const BaseFunc& func,
const tvm::Map<GlobalVar, BaseFunc>& global_funcs,
IRModule IRModule::FromFunc(const BaseFunc& func, const tvm::Map<GlobalVar, BaseFunc>& global_funcs,
const tvm::Map<GlobalTypeVar, TypeData>& type_definitions) {
auto mod = IRModule(global_funcs, type_definitions);
std::string gv_name = "main";
Expand All @@ -335,8 +334,7 @@ IRModule IRModule::FromFunc(const BaseFunc& func,
return mod;
}

IRModule IRModule::FromGraph(const RelayExpr& e,
const tvm::Map<GlobalVar, BaseFunc>& global_funcs,
IRModule IRModule::FromGraph(const RelayExpr& e, const tvm::Map<GlobalVar, BaseFunc>& global_funcs,
const tvm::Map<GlobalTypeVar, TypeData>& type_definitions) {
auto mod = IRModule(global_funcs, type_definitions);
auto func = relay::Function(relay::FreeVars(e), e, Type(), relay::FreeTypeVars(e, mod), {});
Expand Down Expand Up @@ -443,16 +441,16 @@ TVM_REGISTER_GLOBAL("ir.Module_LookupTag").set_body_typed([](IRModule mod, int32
});

TVM_REGISTER_GLOBAL("ir.Module_FromFunc")
.set_body_typed([](BaseFunc f, tvm::Map<GlobalVar, BaseFunc> funcs,
tvm::Map<GlobalTypeVar, TypeData> type_defs) {
return IRModule::FromFunc(f, funcs, type_defs);
});
.set_body_typed([](BaseFunc f, tvm::Map<GlobalVar, BaseFunc> funcs,
tvm::Map<GlobalTypeVar, TypeData> type_defs) {
return IRModule::FromFunc(f, funcs, type_defs);
});

TVM_REGISTER_GLOBAL("ir.Module_FromGraph")
.set_body_typed([](RelayExpr e, tvm::Map<GlobalVar, BaseFunc> funcs,
tvm::Map<GlobalTypeVar, TypeData> type_defs) {
return IRModule::FromGraph(e, funcs, type_defs);
});
.set_body_typed([](RelayExpr e, tvm::Map<GlobalVar, BaseFunc> funcs,
tvm::Map<GlobalTypeVar, TypeData> type_defs) {
return IRModule::FromGraph(e, funcs, type_defs);
});

TVM_REGISTER_GLOBAL("ir.Module_Update").set_body_typed([](IRModule mod, IRModule from) {
mod->Update(from);
Expand Down

0 comments on commit 27c6bdd

Please sign in to comment.