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
yhj050806 and 袁航剑 authored Feb 1, 2021
1 parent 96b0981 commit 2365c7e
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 2365c7e

Please sign in to comment.