Skip to content

Commit

Permalink
[checkpoint] fix attrs
Browse files Browse the repository at this point in the history
  • Loading branch information
mbs-octoml committed Nov 18, 2021
1 parent 54d6ff2 commit 723e18f
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/relay/backend/te_compiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,12 @@ class TECompilerImpl : public TECompilerNode {
for (const auto& kv2 : kv1.second->cached_func->funcs->functions) {
if (const auto* function_node = kv2.second.as<FunctionNode>()) {
auto global_var = kv2.first;
auto function = GetRef<Function>(function_node);
function = WithAttr(std::move(function), attr::kCompiler, NullValue<ObjectRef>());
function = WithAttr(std::move(function), attr::kPrimitive, NullValue<ObjectRef>());
function = WithAttr(std::move(function), attr::kInline, NullValue<ObjectRef>());
function =
WithAttr(std::move(function), tvm::attr::kGlobalSymbol, NullValue<ObjectRef>());
// Abandon the existing annotations.
Function function(function_node->params, function_node->body, function_node->ret_type,
function_node->type_params, /*attrs=*/{}, function_node->span);
// Mark function as extern.
function = WithAttr(std::move(function), attr::kExternalSymbol, global_var->name_hint);
module->Add(global_var, std::move(function));
module->Add(global_var, function);
}
}
}
Expand Down

0 comments on commit 723e18f

Please sign in to comment.