Skip to content

Commit 558c994

Browse files
authored
[TIR][FIX] check args size when creating prim_func by runtime::Registry (#13809)
1 parent c81aaa8 commit 558c994

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/te/operation/create_primfunc.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,7 @@ TVM_REGISTER_GLOBAL("te.CreatePrimFunc").set_body([](TVMArgs args, TVMRetValue*
574574
Array<te::Tensor> arg_list = args[0];
575575
std::optional<DataType> index_dtype_override{std::nullopt};
576576
// Add conversion to make std::optional compatible with FFI.
577+
ICHECK_EQ(args.size(), 2);
577578
if (args[1].type_code() != kTVMNullptr) {
578579
index_dtype_override = args[1].operator DataType();
579580
}

0 commit comments

Comments
 (0)