def METHOD_NAME(N, dtype=np.float64):
    Z = (
        np.random.rand(*N).astype(dtype)
        + np.random.rand(*N).astype(dtype) * 1j
    )
    Z_num = num.array(Z)
    all_kwargs = (
        {},
        {"norm": "forward"},
        {"s": (N[0] // 2, N[1] - 2)},
        {"s": (N[0] + 1, N[0] + 2)},
        {"s": (N[0] // 2 + 1, N[0] + 2)},
        {"axes": (0,)},
        {"axes": (1,)},
        {"axes": (-1,)},
        {"axes": (-2,)},
        {"axes": (0, 1)},
        {"axes": (1, 0)},
        {"axes": (1, 0, 1)},
    )
    for kwargs in all_kwargs:
        print(f"=== 2D C2R {dtype}, args: {kwargs} ===")
        out = np.fft.irfft2(Z, **kwargs)
        out_num = num.fft.irfft2(Z_num, **kwargs)
        assert allclose(out, out_num)
        out = np.fft.irfft2(np.swapaxes(Z, 0, 1), **kwargs)
        out_num = num.fft.irfft2(num.swapaxes(Z_num, 0, 1), **kwargs)
        assert allclose(out, out_num)
    # Odd types
    out = np.fft.rfft2(Z)
    out_num = num.fft.rfft2(Z_num)
    assert allclose(out, out_num)
    out = np.fft.ihfft(Z)
    out_num = num.fft.ihfft(Z_num)
    assert allclose(out, out_num)
    assert allclose(Z, Z_num)