So, I think there are a couple of different questions here:


The first one is that you want to insert a module in op by op instead of the entire module at once. I think the easiest way of doing this is through creating proxies and implicitly creating your graph. You would use the inserting_before, and then initialize the proxies and call your module: examples/proxy_based_graph_creation.py at master · pytorch/examples · GitHub 5


The other issue is that the new graph is referring to modules that don’t currently exist in your graph. You currently need to resolve this yourself, by inserting your modules into your GraphModule.