In some kernels, a tensor may be not used for some cases (e.g., with a specific template parameter), then users may pass None (nullptr) as the T.ptr. But ValueError: Unsupported tensor type: <class 'NoneType'> will be raised.
For example,
@T.prim_func
def main(
a_ptr: T.ptr,
b_ptr: T.ptr,
c_ptr: T.ptr,
bias_ptr: T.ptr,
m: T.int32,
n: T.int32,
k: T.int32,
with_bias: T.int32
):
with with_bias = 0, we expect bias_ptr as nullptr (but not forcing users to create a useless empty tensor).