Skip to content

Commit

Permalink
Fix parsing error caused by dot-separated variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
Njuapp committed Jun 13, 2022
1 parent 666a263 commit 4a74c4f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,15 @@ torch::jit::Module CompileGraph(const torch::jit::Module& mod, CompileSpec cfg)
auto engine = conversion::ConvertBlockToEngine(g->block(), cfg.convert_info, static_params);
AddEngineToGraph(new_mod, new_g, engine, cuda_device);
}
for(auto input: new_g->block()->inputs()){
LOG_DEBUG("input name:" << input->debugName());
if(input->debugName().find(".") != std::string::npos){
auto pos = input->debugName().find(".");
auto newName = input->debugName().replace(pos, 1, "_");
input->setDebugName(newName);
LOG_DEBUG("changed name:" << input->debugName());
}
}
auto new_method = new_mod._ivalue()->compilation_unit()->create_function(method.name(), new_g);
auto schema = util::GenerateGraphSchema(new_method->name(), new_g);
new_mod.type()->addMethod(new_method);
Expand Down

0 comments on commit 4a74c4f

Please sign in to comment.