Skip to content

Commit a9db5ea

Browse files
authored
[Refactor] Simplify code for onehot (#283)
1 parent 9ce25ea commit a9db5ea

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/target/generic_cpp/onehot.cc

+2-5
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,8 @@ void GenericCXXCodeGen::RunOnInstruction(OneHotInst* inst) {
3737

3838
CXXValue ret(inst->GetName(), op0.type);
3939

40-
os_ << " " << EmitLValue(ret.name) << " = odla_Onehot("
41-
<< Join("comp", GetODLAType(ret_type.GetDataType()), EmitShape(lhs_type),
42-
op0.name, EmitShape(rhs_type), op1.name, op_on.name, op_off.name,
43-
inst->GetAxis(), EmitShape(ret_type))
44-
<< ");\n";
40+
EmitODLACall(ret, "odla_Onehot", ret_type.GetDataType(), lhs_type, op0,
41+
rhs_type, op1, op_on, op_off, inst->GetAxis(), ret_type);
4542
ir_mapping_[*inst] = ret;
4643
}
4744

0 commit comments

Comments
 (0)