Skip to content

Commit

Permalink
fix duplicated symbol bug in external codegen (apache#7383)
Browse files Browse the repository at this point in the history
Co-authored-by: 袁航剑 <yuanhangjian@bytedance.com>
  • Loading branch information
2 people authored and alexwong committed Feb 11, 2021
1 parent 086fde9 commit f9d2196
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/relay/backend/compile_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -651,10 +651,10 @@ class CompileEngineImpl : public CompileEngineNode {
<< AsText(src_func, false);

std::string sn = symbol_name.value();
if (cached_symbol.count(sn)) {
if (!cached_symbol.count(sn)) {
cached_symbol[sn] = code_gen_name;
} else {
ICHECK_NE(sn, code_gen_name)
ICHECK_NE(cached_symbol[sn], code_gen_name)
<< "Found duplicated symbol: " << sn << " for: " << code_gen_name;
}

Expand Down

0 comments on commit f9d2196

Please sign in to comment.