コード例 #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)
コード例 #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)
コード例 #3
0
ファイル: test_cbrng.py プロジェクト: simonlegrand/reikna
 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)
コード例 #4
0
 def get_sampler(self, bijection, dtype):
     return uniform_integer(bijection, dtype, self.extent[0], self.extent[1] + 1)
コード例 #5
0
ファイル: test_cbrng.py プロジェクト: simonlegrand/reikna
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)