Exemplo n.º 1
0
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)
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
 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)
Exemplo n.º 4
0
 def get_sampler(self, bijection, dtype):
     return uniform_integer(bijection, dtype, self.extent[0], self.extent[1] + 1)
Exemplo n.º 5
0
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)