tvm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <>
Subject [GitHub] [incubator-tvm] t-vi commented on a change in pull request #5822: fix to not change the module argument in place
Date Tue, 16 Jun 2020 09:31:54 GMT

t-vi commented on a change in pull request #5822:

File path: src/relay/backend/
@@ -244,6 +244,9 @@ class RelayBuildModule : public runtime::ModuleNode {
       GlobalVar main_glb_var = relay_module->GetGlobalVar("main");
       Function main_func = Downcast<Function>(relay_module->Lookup(main_glb_var));
       auto new_main = BindParamsByName(main_func, params);
+      // copy module to avoid changing our input
+      relay_module = IRModule(relay_module->functions, relay_module->type_definitions,

Review comment:
       OK, so I changed it to call `CopyOnWrite` and it appears to work.
   To understand this better, I got the re-instatiation from `FunctionPassNode::operator()`
   is there a reason that isn't done via `CopyOnWrite`?
   Superficially, it seems that the update is then
   which would seem very similar to the `Update` done in the `Optimize`
   which itself just calls add
   Is  something that could also use `CopyOnWrite` or is it not applicable there.

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.

For queries about this service, please contact Infrastructure at:

View raw message