def METHOD_NAME(topi_name, dtype):
    config = ewise_operations[topi_name]
    input_range = config["input_range"]
    shape = config.get("shape", (20, 3))
    a_np = np.random.uniform(*input_range, size=shape).astype(dtype)
    if dtype.startswith("float"):
        if config.get("replace_with_nan", False):
            a_np.ravel()[np.random.choice(a_np.size, int(a_np.size * 0.5), replace=False)] = np.nan
        if config.get("replace_with_inf", False):
            a_np.ravel()[
                np.random.choice(a_np.size, int(a_np.size * 0.5), replace=False)
            ] = np.infty
    # avoid round check too close to boundary
    if topi_name == "round":
        a_np += ((np.abs(np.fmod(a_np, 1)) - 0.5) < 1e-6) * 1e-4
    b_np = config["ref"](a_np)
    if config.get("cast_output", False):
        b_np = b_np.astype(dtype)
    return a_np, b_np