def test_64_to_32_bit(thr): extent = (0, 2**31 - 1) mean, std = uniform_discrete_mean_and_std(*extent) bijection = philox(64, 4) sampler = uniform_integer(bijection, numpy.uint32, extent[0], extent[1] + 1) check_kernel_sampler(thr, sampler, extent=extent, mean=mean, std=std)
def __init__(self, bijection, min_, max_): self.extent = (min_, max_) self.mean, self.std = uniform_discrete_mean_and_std(*self.extent) self.name = 'uniform_integer' self.sampler = uniform_integer(bijection, numpy.int32, min_, max_ + 1)
def get_sampler(self, bijection, dtype): return uniform_integer(bijection, dtype, self.extent[0], self.extent[1] + 1)
def test_64_to_32_bit(thr): extent = (0, 2**31-1) mean, std = uniform_discrete_mean_and_std(*extent) bijection = philox(64, 4) sampler = uniform_integer(bijection, numpy.uint32, extent[0], extent[1] + 1) check_kernel_sampler(thr, sampler, extent=extent, mean=mean, std=std)