def METHOD_NAME(rng, ndim: int, batch_size: int, in_dtype: np.dtype, out_dtype: np.dtype,
             empty_volume_policy: str):
    lo, hi = -1000, 1000
    if np.issubdtype(out_dtype, np.integer):
        lo = np.iinfo(out_dtype).min
        hi = np.iinfo(out_dtype).max
        if hi < np.iinfo(np.int64).max:
            r = hi - lo
            hi += r // 2
            lo -= r // 2
        if np.issubdtype(in_dtype, np.integer):
            lo = max(np.iinfo(in_dtype).min, lo)
            hi = min(np.iinfo(in_dtype).max, hi)
        else:
            lo = max(-np.finfo(in_dtype).max, lo)
            hi = min(np.finfo(in_dtype).max, hi)
    max_size = 100000 // batch_size
    out = [rng.uniform(lo, hi, size=random_shape(rng, ndim, max_size)).astype(in_dtype) for _ in
           range(batch_size)]
    out = replace_with_empty_volumes(rng, out, empty_volume_policy)
    if np.issubdtype(in_dtype, np.floating) and np.issubdtype(out_dtype, np.integer):
        for x in out:
            # avoid exactly halfway numbers - rounding is different for CPU and GPU
            halfway = x[x - np.floor(x) == 0.5]
            x[x - np.floor(x) == 0.5] = np.nextafter(halfway, np.Infinity)
    return out