Skip to content

Commit 51f5a76

Browse files
committed
Fix parsing error caused by dot-separated variable debugNames
Signed-off-by: Cheng Hang <[email protected]>
1 parent 666a263 commit 51f5a76

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

core/compiler.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,15 @@ torch::jit::Module CompileGraph(const torch::jit::Module& mod, CompileSpec cfg)
447447
auto engine = conversion::ConvertBlockToEngine(g->block(), cfg.convert_info, static_params);
448448
AddEngineToGraph(new_mod, new_g, engine, cuda_device);
449449
}
450+
for (auto input : new_g->block()->inputs()) {
451+
LOG_DEBUG("input name:" << input->debugName());
452+
if (input->debugName().find(".") != std::string::npos) {
453+
auto pos = input->debugName().find(".");
454+
auto newName = input->debugName().replace(pos, 1, "_");
455+
input->setDebugName(newName);
456+
LOG_DEBUG("changed name:" << input->debugName());
457+
}
458+
}
450459
auto new_method = new_mod._ivalue()->compilation_unit()->create_function(method.name(), new_g);
451460
auto schema = util::GenerateGraphSchema(new_method->name(), new_g);
452461
new_mod.type()->addMethod(new_method);

0 commit comments

Comments
 (0)