def METHOD_NAME(dshape, begin, end, strides, slice_mode="end", test_ref=True, dtype="int32"):
    x = relay.var("x", relay.TensorType(dshape, "float32"))
    ndim = len(dshape)
    slice_dim = len(begin)
    begin = begin if begin else [0] * ndim
    end = end if end else list(dshape)[:slice_dim]
    if strides:
        if len(strides) == 1:
            strides = strides * slice_dim
    else:
        strides = [1] * slice_dim
    num_static_axes = len(dshape) - len(begin)
    # target numpy result
    x_data = np.random.uniform(size=dshape).astype("float32")
    ref_res = tvm.topi.testing.strided_slice_python(x_data, begin, end, strides, slice_mode)
    data = [x_data, np.array(begin, dtype=dtype), np.array(end, dtype=dtype)]
    begin = relay.var("begin", shape=[len(begin)], dtype=dtype)
    end = relay.var("end", shape=[len(end)], dtype=dtype)
    inputs = [x, begin, end]
    if strides:
        data.append(np.array(strides, dtype=dtype))
        strides = relay.var("strides", shape=[len(strides)], dtype=dtype)
        inputs.append(strides)
        z = relay.strided_slice(x, begin=begin, end=end, strides=strides, slice_mode=slice_mode)
    else:
        z = relay.strided_slice(x, begin=begin, end=end, slice_mode=slice_mode)
    func = relay.Function(inputs, z)
    func = run_infer_type(func)
    if num_static_axes > 0:
        oshape = run_infer_type(z).checked_type.shape
        assert tuple(oshape[-num_static_axes:]) == dshape[-num_static_axes:]
    if not test_ref:
        return
    for target, dev in tvm.testing.enabled_targets():
        mod = tvm.ir.IRModule.from_expr(func)
        op_res = relay.create_executor("vm", mod=mod, device=dev, target=target).evaluate()(
            *data
        )
        tvm.testing.assert_allclose(op_res.numpy(), ref_res)