manupa-arm commented on a change in pull request #10375:
URL: https://github.com/apache/tvm/pull/10375#discussion_r814747174
##########
File path: src/relay/backend/contrib/cmsisnn/scalar_to_tensor_constant.cc
##########
@@ -177,14 +173,22 @@ class ScalarToTensorConstantMutator : public
MixedModeMutator {
};
IRModule ScalarToTensorConstant(const IRModule& mod) {
- auto mutator = ScalarToTensorConstantMutator(mod);
- Function main_func = Downcast<Function>(mod->Lookup("main"));
- auto new_main_body = mutator.VisitExpr(main_func->body);
- if (!new_main_body.same_as(main_func->body)) {
- auto main_var = mod->GetGlobalVar("main");
- auto new_main_func = Function(main_func->params, new_main_body,
main_func->ret_type,
- main_func->type_params, main_func->attrs);
- mod->Update(main_var, new_main_func);
+ for (auto gv : mod->GetGlobalVars()) {
+ Function main_func = Downcast<Function>(mod->Lookup(gv));
Review comment:
nit : main function seems not right here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]