Skip to content

Commit

Permalink
[External Codegen] Fix annotate pass static variable (#5023)
Browse files Browse the repository at this point in the history
'fannotate' in the annotate_target pass was designated as
static. This meant that if you use the pass to annotate
more than one codegen, its value is not updated when the
target changes resulting in incorrect annotation.

Change-Id: Ib4f3af5cfbef44f29771818219755198ac313a0e
  • Loading branch information
mbaret authored Mar 27, 2020
1 parent 68046ba commit 949dca4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/relay/transforms/annotate_target.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class AnnotateTargetWrapper : public ExprMutator {
auto new_e = ExprMutator::VisitExpr_(cn);

Call call = Downcast<Call>(new_e);
static auto fannotate = Op::GetAttr<FTVMAnnotateTarget>("target." + target_);
auto fannotate = Op::GetAttr<FTVMAnnotateTarget>("target." + target_);
Op op = Downcast<Op>(call->op);
CHECK(op.defined());

Expand Down

0 comments on commit 949dca4

Please sign in to comment.