The result of sparse_conv2d op is different in each run

The following is an example:

dtype="float32"
x_shape = (1, 1, 3, 3)
w_shape = (1, 1, 1, 1)
x_np = np.random.random_sample(x_shape).astype(dtype)
np.savetxt("x_np.npy", x_np.flatten())
x_np = np.loadtxt("x_np.npy").reshape(x_shape).astype(dtype)
x = relay.var("x", shape=x_shape, dtype=dtype)
w_data = relay.const(make_arr(w_shape[1:], dtype))
w_indptrs = relay.const([0,1], "int32")
w_indices = relay.const([0], "int32")
z = relay.op.nn._make.sparse_conv2d(x, w_data, w_indices, w_indptrs, "NCHW")
func = relay.Function([x], z)
mod = tvm.IRModule().from_expr(func)
params = {}
inputs = {"x":tvm.nd.array(x_np)}
with tvm.transform.PassContext(opt_level=2):
   exe = relay.backend.vm.compile(mod=mod, params=params, target="llvm")
vm = tvm.runtime.vm.VirtualMachine(exe, device=tvm.device("llvm"))
out = vm.run(**{**params, **inputs})

The result of each run with the same input is different.

Which version of TVM are you on. I try running this and I don’t have a make_arr defined. Anyway, sparse_conv2d takes 6 arguments not 5 I get

TVMError: Function relay.op.nn._make.sparse_conv2d expects 6 arguments, but 5 were provided.

I use the version with commit, “dbdfc444”. The following code is function, “make_arr”:

def make_arr(shape, dtype):
    """ Make random numpy array by the shape and the dtype """
    arr = np.array([0])
    epsilon = 1e-10
    if "float" in dtype:
        dtype = "float32" if dtype=="float" else dtype
        while abs(arr).any() < epsilon: arr = (10*np.random.random_sample(shape)-5).astype(dtype)
    elif "uint" in dtype:
        range = 2**(int(re.search(r'\d+$',dtype).group()))
        low, high = 1, range
        arr = np.random.randint(low, high, shape, dtype)
    elif "int" in dtype:
        half = 2**(int(re.search(r'\d+$',dtype).group())-1)
        arr = np.random.randint(1, half-1, shape, dtype)*np.random.choice([-1,1],shape).astype(dtype)
    elif "bool" in dtype:
        arr = np.random.choice([True, False], shape)
    else:
        raise TypeError(f"{dtype} is not kind of data type.")
    return arr