File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -43,12 +43,17 @@ void NotateModuleForFallback(
43
43
" Notating module for fallback: " << n->s (c10::attr::name) << " (" << out_type << " ) [owner: " << mod_name
44
44
<< " (" << cls_name << " )]" );
45
45
auto uses = n->output (0 )->uses ();
46
+ int k = 0 ;
46
47
for (const auto u : uses) {
48
+ auto compilation_context_node = g->createNone ();
49
+ auto compilation_context = compilation_context_node->outputs ()[0 ];
50
+ compilation_context->setDebugName (" compilation_context_" + std::to_string (k++));
47
51
auto user = u.user ;
48
- auto delim_start_n = g->create (torch::jit::prim::Enter, 0 );
52
+ auto delim_start_n = g->create (torch::jit::prim::Enter, {compilation_context} );
49
53
delim_start_n->s_ (c10::Symbol::attr (" compilation_edge" ), " start" );
50
- auto delim_end_n = g->create (torch::jit::prim::Exit, 0 );
54
+ auto delim_end_n = g->create (torch::jit::prim::Exit, {compilation_context} );
51
55
delim_end_n->s_ (c10::Symbol::attr (" compilation_edge" ), " end" );
56
+ compilation_context_node->insertBefore (user);
52
57
delim_start_n->insertBefore (user);
53
58
delim_end_n->insertAfter (user);
54
59
}
You can’t perform that action at this time.
0 commit comments