Skip to content

Commit

Permalink
[TIR][FIX] check args size when creating prim_func by runtime::Regist…
Browse files Browse the repository at this point in the history
…ry (apache#13809)
  • Loading branch information
Ever-Kid authored Jan 31, 2023
1 parent c81aaa8 commit 558c994
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/te/operation/create_primfunc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,7 @@ TVM_REGISTER_GLOBAL("te.CreatePrimFunc").set_body([](TVMArgs args, TVMRetValue*
Array<te::Tensor> arg_list = args[0];
std::optional<DataType> index_dtype_override{std::nullopt};
// Add conversion to make std::optional compatible with FFI.
ICHECK_EQ(args.size(), 2);
if (args[1].type_code() != kTVMNullptr) {
index_dtype_override = args[1].operator DataType();
}
Expand Down

0 comments on commit 558c994

Please sign in to comment.