Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
electriclilies committed Nov 3, 2021
1 parent ac3d0e2 commit 35f2636
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/relay/backend/aot_executor_codegen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,8 @@ class AOTExecutorCodegen : public MixedModeVisitor {

tvm::Array<PrimExpr> args{tvm::tir::StringImm(func_name)};
std::vector<tir::Stmt> create_func_call_stmts;
// Pack the inputs

// Pack the inputs
for (Expr arg : call_args) {
if (params_by_expr_.find(arg) != params_by_expr_.end()) {
auto param_handle = tvm::tir::Call(DataType::Handle(), tvm::tir::builtin::lookup_param(),
Expand Down
6 changes: 4 additions & 2 deletions src/relay/backend/te_compiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,8 @@ class LowerTensorExprMutator : public DeviceAwareExprMutator {
}

Expr DeviceAwareVisitExpr_(const CallNode* call_node) override {
ICHECK(call_node->op != CallLoweredOp()) << "Found a call_lowered op: can't lower a function that is already lowered.";
ICHECK(call_node->op != CallLoweredOp())
<< "Found a call_lowered op: can't lower a function that is already lowered.";
Call call = GetRef<Call>(call_node);
// Look for (indirect) calls to primitives.
BaseFunc prim_func = ResolveToPrimitive(call_node->op);
Expand Down Expand Up @@ -633,7 +634,8 @@ class LowerTensorExprMutator : public DeviceAwareExprMutator {
for (const auto& arg : call_node->args) {
args.push_back(VisitExpr(arg));
}
return CallLowered(pair.first, Tuple(args), Attrs(call_lowered_attrs), call_node->type_args, call_node->span);
return CallLowered(pair.first, Tuple(args), Attrs(call_lowered_attrs), call_node->type_args,
call_node->span);
}

IRModule module_;
Expand Down
6 changes: 3 additions & 3 deletions src/relay/op/call/call.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ Expr CallLowered(Expr func, Expr inputs, Attrs attrs, Array<Type> type_args, Spa
// function.
ICHECK(func.as<GlobalVarNode>())
<< "Function to call should be GlobalVarNode, but got " << func->GetTypeKey();
ICHECK(inputs.as<TupleNode>())
<< "Inputs to call_lowered should be TupleNode, but got " << inputs->GetTypeKey();
ICHECK(inputs.as<TupleNode>()) << "Inputs to call_lowered should be TupleNode, but got "
<< inputs->GetTypeKey();
return Call(CallLoweredOp(), {func, inputs}, attrs);
}

TVM_REGISTER_GLOBAL("relay.op.call_lowered").set_body_typed(CallLowered); // TODO(@electriclilies): Not sure if type args and span are OK for registered op?
TVM_REGISTER_GLOBAL("relay.op.call_lowered").set_body_typed(CallLowered);

RELAY_REGISTER_OP("call_lowered")
.describe(R"code(Invoke an operation compiled by TVM.)code" TVM_ADD_FILELINE)
Expand Down

0 comments on commit 35f2636

Please sign in to comment.