Home
last modified time | relevance | path

Searched refs:random (Results 1 – 25 of 2301) sorted by relevance

12345678910>>...93

/external/python/cpython3/Modules/_decimal/tests/
Drandfloat.py6 import random
24 n, e = random.randrange(lower, upper, 2), k
59 bits = random.randrange(2047*2**52)
94 digits = n + random.randrange(-3*u, 3*u)
109 digits = base + random.randrange(-1000, 1000)
117 digits = random.randrange(dig10)
118 exponent = random.randrange(-400, 400)
131 s = random.choice(signs)
132 intpart_len = random.randrange(5)
133 s += ''.join(random.choice(digits) for _ in range(intpart_len))
[all …]
Dformathelper.py32 import os, sys, locale, random
232 i = random.randrange(0, 0x110002)
239 active = sorted(random.sample(range(7), random.randrange(8)))
245 s += random.choice('<>=^')
248 s += random.choice('+- ')
252 s += str(random.randrange(1, 100))
257 s += str(random.randrange(100))
261 s += random.choice(c)
277 type = random.choice(('', 'E', 'e', 'G', 'g', 'F', 'f', '%'))
296 active = sorted(random.sample(range(5), random.randrange(6)))
[all …]
/external/guava/guava-tests/test/com/google/common/hash/
DHashTestUtils.java92 @Override void performAction(Random random, Iterable<? extends PrimitiveSink> sinks) { in PUT_BOOLEAN() argument
93 boolean value = random.nextBoolean(); in PUT_BOOLEAN()
100 @Override void performAction(Random random, Iterable<? extends PrimitiveSink> sinks) { in PUT_BYTE() argument
101 int value = random.nextInt(); in PUT_BYTE()
108 @Override void performAction(Random random, Iterable<? extends PrimitiveSink> sinks) { in PUT_SHORT() argument
109 short value = (short) random.nextInt(); in PUT_SHORT()
116 @Override void performAction(Random random, Iterable<? extends PrimitiveSink> sinks) { in PUT_CHAR() argument
117 char value = (char) random.nextInt(); in PUT_CHAR()
124 @Override void performAction(Random random, Iterable<? extends PrimitiveSink> sinks) { in PUT_INT() argument
125 int value = random.nextInt(); in PUT_INT()
[all …]
/external/tensorflow/tensorflow/core/kernels/
Drandom_op_gpu.cu.cc46 T* buf, const tensorflow::random::Array<T, ElementCount>& array) const { in operator ()()
61 float* buf, const tensorflow::random::Array<float, 4>& array) const { in operator ()()
82 int32* buf, const tensorflow::random::Array<int32, 4>& array) const { in operator ()()
100 double* buf, const tensorflow::random::Array<double, 2>& array) const { in operator ()()
116 int64* buf, const tensorflow::random::Array<int64, 2>& array) const { in operator ()()
130 PHILOX_DEVICE_FUNC void Run(random::PhiloxRandom gen, T* data, int64 size, in Run()
164 PHILOX_DEVICE_FUNC void Run(const random::PhiloxRandom& base_gen, T* data, in Run()
166 using random::PhiloxRandom; in Run()
167 using random::SingleSampleAdapter; in Run()
206 FillPhiloxRandomKernelLaunch(random::PhiloxRandom base_gen, in FillPhiloxRandomKernelLaunch()
[all …]
Dstateless_random_ops.cc68 random::PhiloxRandom::Key key; in Compute()
69 random::PhiloxRandom::ResultType counter; in Compute()
76 const auto mix = random::PhiloxRandom(counter, key)(); in Compute()
84 Fill(context, random::PhiloxRandom(counter, key), output); in Compute()
88 virtual void Fill(OpKernelContext* context, random::PhiloxRandom random,
97 void Fill(OpKernelContext* context, random::PhiloxRandom random, in Fill() argument
103 context, context->eigen_device<Device>(), random, flat.data(), in Fill()
116 StatelessRandomOp<CPUDevice, random::UniformDistribution< \
117 random::PhiloxRandom, TYPE> >); \
123 StatelessRandomOp<CPUDevice, random::NormalDistribution< \
[all …]
Drandom_op.cc56 using random::PhiloxRandom;
57 using random::SingleSampleAdapter;
65 void operator()(OpKernelContext*, const Device&, random::PhiloxRandom gen, in operator ()()
80 static void Run(random::PhiloxRandom gen, T* data, int64 size, in Run()
111 static void Run(random::PhiloxRandom base_gen, T* data, int64 size, in Run()
155 OpKernelContext* context, const CPUDevice&, random::PhiloxRandom gen, in operator ()()
165 random::PhiloxRandom::kResultElementCount * in operator ()()
166 (random::PhiloxRandom::kElementCost + Distribution::kElementCost); in operator ()()
242 typedef random::UniformDistribution<random::PhiloxRandom, IntType> in Compute()
300 using random::PhiloxRandom; in Compute()
[all …]
/external/tensorflow/tensorflow/python/keras/_impl/keras/engine/
Dtopology_test.py118 x = np.random.random((3, 2))
176 input_a_np = np.random.random((10, 32))
177 input_b_np = np.random.random((10, 32))
307 input_a_np = np.random.random((10, 32))
308 input_b_np = np.random.random((10, 32))
329 input_a_np = np.random.random((10, 32))
330 input_b_np = np.random.random((10, 32))
377 input_a_np = np.random.random((10, 32))
378 input_b_np = np.random.random((10, 32))
388 input_a_np = np.random.random((10, 32))
[all …]
Dtraining_test.py58 input_a_np = np.random.random((10, 3))
59 input_b_np = np.random.random((10, 3))
61 output_d_np = np.random.random((10, 4))
62 output_e_np = np.random.random((10, 4))
199 bad_input = np.random.random((11, 3))
203 bad_target = np.random.random((11, 4))
218 input_a_np = np.random.random((10, 3))
219 input_b_np = np.random.random((10, 4))
250 input_a_np = np.random.random((10, 3))
251 input_b_np = np.random.random((10, 3))
[all …]
/external/skia/src/gpu/
DGrTestUtils.cpp21 static const SkMatrix& test_matrix(SkRandom* random, in test_matrix() argument
44 return gMatrices[random->nextULessThan(count)]; in test_matrix()
46 return gMatrices[count - 1 - random->nextULessThan(kPerspectiveCount)]; in test_matrix()
49 return gMatrices[random->nextULessThan(count - kPerspectiveCount)]; in test_matrix()
54 const SkMatrix& TestMatrix(SkRandom* random) { return test_matrix(random, true, true); } in TestMatrix() argument
56 const SkMatrix& TestMatrixPreservesRightAngles(SkRandom* random) { in TestMatrixPreservesRightAngles() argument
79 return gMatrices[random->nextULessThan(static_cast<uint32_t>(SK_ARRAY_COUNT(gMatrices)))]; in TestMatrixPreservesRightAngles()
82 const SkMatrix& TestMatrixRectStaysRect(SkRandom* random) { in TestMatrixRectStaysRect() argument
105 return gMatrices[random->nextULessThan(static_cast<uint32_t>(SK_ARRAY_COUNT(gMatrices)))]; in TestMatrixRectStaysRect()
108 const SkMatrix& TestMatrixInvertible(SkRandom* random) { return test_matrix(random, true, false); } in TestMatrixInvertible() argument
[all …]
/external/skqp/src/gpu/
DGrTestUtils.cpp21 static const SkMatrix& test_matrix(SkRandom* random, in test_matrix() argument
44 return gMatrices[random->nextULessThan(count)]; in test_matrix()
46 return gMatrices[count - 1 - random->nextULessThan(kPerspectiveCount)]; in test_matrix()
49 return gMatrices[random->nextULessThan(count - kPerspectiveCount)]; in test_matrix()
54 const SkMatrix& TestMatrix(SkRandom* random) { return test_matrix(random, true, true); } in TestMatrix() argument
56 const SkMatrix& TestMatrixPreservesRightAngles(SkRandom* random) { in TestMatrixPreservesRightAngles() argument
79 return gMatrices[random->nextULessThan(static_cast<uint32_t>(SK_ARRAY_COUNT(gMatrices)))]; in TestMatrixPreservesRightAngles()
82 const SkMatrix& TestMatrixRectStaysRect(SkRandom* random) { in TestMatrixRectStaysRect() argument
105 return gMatrices[random->nextULessThan(static_cast<uint32_t>(SK_ARRAY_COUNT(gMatrices)))]; in TestMatrixRectStaysRect()
108 const SkMatrix& TestMatrixInvertible(SkRandom* random) { return test_matrix(random, true, false); } in TestMatrixInvertible() argument
[all …]
/external/apache-commons-math/src/main/java/org/apache/commons/math/random/
DBitsStreamGenerator.java17 package org.apache.commons.math.random;
69 final int random = next(32); in nextBytes() local
70 bytes[i] = (byte) (random & 0xff); in nextBytes()
71 bytes[i + 1] = (byte) ((random >> 8) & 0xff); in nextBytes()
72 bytes[i + 2] = (byte) ((random >> 16) & 0xff); in nextBytes()
73 bytes[i + 3] = (byte) ((random >> 24) & 0xff); in nextBytes()
76 int random = next(32); in nextBytes() local
78 bytes[i++] = (byte) (random & 0xff); in nextBytes()
79 random = random >> 8; in nextBytes()
98 final double random; in nextGaussian() local
[all …]
/external/python/cpython2/Lib/
Drandom.py192 return _int(self.random() * istart)
216 return _int(istart + _int(self.random()*width))
236 return istart + istep*_int(self.random() * n)
260 if type(self.random) is _BuiltinMethod or type(getrandbits) is _Method:
269 return _int(self.random() * n)
275 return seq[int(self.random() * len(seq))] # raises IndexError if seq is empty
277 def shuffle(self, x, random=None): argument
285 if random is None:
286 random = self.random
290 j = _int(random() * (i+1))
[all …]
/external/python/cpython3/Lib/
Drandom.py226 random = self.random
230 if type(random) is BuiltinMethod or type(getrandbits) is Method:
242 return int(random() * n)
245 r = random()
247 r = random()
260 def shuffle(self, x, random=None): argument
269 if random is None:
279 j = _int(random() * (i+1))
347 random = self.random
352 return [population[_int(random() * total)] for i in range(k)]
[all …]
/external/eigen/test/
Dsvd_fill.h29 s = internal::random<RealScalar>(1,s);
32 d(k) = d(k)*pow(RealScalar(10),internal::random<RealScalar>(-s,s));
34 bool dup = internal::random<int>(0,10) < 3;
35 …bool unit_uv = internal::random<int>(0,10) < (dup?7:3); // if we duplicate some diagonal entries, …
40 Index n = internal::random<Index>(0,d.size()-1);
42 d(internal::random<Index>(0,d.size()-1)) = d(internal::random<Index>(0,d.size()-1));
50 if(internal::random<int>(0,10) < 1)
77 Index count = internal::random<Index>(-diagSize,diagSize);
80 Index i = internal::random<Index>(0,diagSize-1);
89 Index n = internal::random<Index>(0,m.size()-1);
[all …]
Dproduct_large.cpp15 int rows = internal::random<int>(1,12); in test_aliasing()
16 int cols = internal::random<int>(1,12); in test_aliasing()
36 …CALL_SUBTEST_1( product(MatrixXf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<in… in test_product_large()
37 …CALL_SUBTEST_2( product(MatrixXd(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<in… in test_product_large()
38 …CALL_SUBTEST_3( product(MatrixXi(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<in… in test_product_large()
39 …CALL_SUBTEST_4( product(MatrixXcf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2), internal::random in test_product_large()
40 …(Matrix<float,Dynamic,Dynamic,RowMajor>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::ra… in test_product_large()
64 std::ptrdiff_t l1 = internal::random<int>(10000,20000); in test_product_large()
65 std::ptrdiff_t l2 = internal::random<int>(100000,200000); in test_product_large()
66 std::ptrdiff_t l3 = internal::random<int>(1000000,2000000); in test_product_large()
[all …]
/external/pdfium/third_party/base/allocator/partition_allocator/
Daddress_space_randomization.cc90 uintptr_t random; in GetRandomPageBase() local
91 random = static_cast<uintptr_t>(ranval(&s_ranctx)); in GetRandomPageBase()
93 random <<= 32UL; in GetRandomPageBase()
94 random |= static_cast<uintptr_t>(ranval(&s_ranctx)); in GetRandomPageBase()
98 random &= 0x3ffffffffffUL; in GetRandomPageBase()
107 random += 0x10000000000UL; in GetRandomPageBase()
111 random &= 0x007fffffffffUL; in GetRandomPageBase()
112 random += 0x7e8000000000UL; in GetRandomPageBase()
115 random &= 0x3fffffffffffUL; in GetRandomPageBase()
119 random &= 0x3fffffffffUL; in GetRandomPageBase()
[all …]
/external/llvm/test/Analysis/BasicAA/
Dnegoffset.ll6 declare i32* @random.i32(i32* %ptr)
13 %random = call i32* @random.i32(i32* %alloca)
14 %p0 = getelementptr inbounds i32, i32* %random, i32 0
15 %p1 = getelementptr inbounds i32, i32* %random, i32 1
23 %random = call i32* @random.i32(i32* %arg)
24 %p0 = getelementptr inbounds i32, i32* %random, i32 0
25 %p1 = getelementptr inbounds i32, i32* %random, i32 1
34 %random = call i32* @random.i32(i32* @gv)
35 %p0 = getelementptr inbounds i32, i32* %random, i32 0
36 %p1 = getelementptr inbounds i32, i32* %random, i32 1
[all …]
/external/tensorflow/tensorflow/contrib/sparsemax/python/kernel_tests/
Dsparsemax_test.py79 def _test_sparsemax_against_numpy(self, dtype, random, use_gpu): argument
81 z = random.uniform(low=-3, high=3, size=(test_obs, 10))
90 def _test_sparsemax_of_zero(self, dtype, random, use_gpu): argument
100 def _test_sparsemax_of_inf(self, dtype, random, use_gpu): argument
102 z = random.uniform(low=-3, high=3, size=(test_obs, 10))
120 def _test_constant_add(self, dtype, random, use_gpu): argument
122 z = random.uniform(low=-3, high=3, size=(test_obs, 10)).astype(dtype)
123 c = random.uniform(low=-3, high=3, size=(test_obs, 1)).astype(dtype)
132 def _test_permutation(self, dtype, random, use_gpu): argument
134 z = random.uniform(low=-3, high=3, size=(test_obs, 10))
[all …]
Dsparsemax_loss_test.py99 def _test_sparsemax_loss_against_numpy(self, dtype, random, use_gpu): argument
101 z = random.uniform(low=-3, high=3, size=(test_obs, 10))
103 q[np.arange(0, test_obs), random.randint(0, 10, size=test_obs)] = 1
112 def _test_constant_add(self, dtype, random, use_gpu): argument
114 z = random.uniform(low=-3, high=3, size=(test_obs, 10))
115 c = random.uniform(low=-3, high=3, size=(test_obs, 1))
117 q[np.arange(0, test_obs), np.random.randint(0, 10, size=test_obs)] = 1
131 def _test_sparsemax_loss_positive(self, dtype, random, use_gpu): argument
133 z = random.uniform(low=-3, high=3, size=(test_obs, 10))
135 q[np.arange(0, test_obs), random.randint(0, 10, size=test_obs)] = 1
[all …]
/external/tensorflow/tensorflow/python/keras/_impl/keras/preprocessing/
Dimage_test.py40 bias = np.random.rand(img_w, img_h, 1) * 64
41 variance = np.random.rand(img_w, img_h, 1) * (255 - 64)
42 imarray = np.random.rand(img_w, img_h, 3) * variance + bias
46 imarray = np.random.rand(img_w, img_h, 1) * variance + bias
82 x = np.random.random((32, 10, 10, 3))
106 x = np.random.random((3, 10, 10))
112 x = np.random.random((32, 10, 10, 5))
134 x = np.random.random((32, 10, 10, 1))
137 x = np.random.random((32, 10, 10, 3))
147 x = np.random.random((32, 1, 10, 10))
[all …]
/external/tensorflow/tensorflow/python/keras/_impl/keras/layers/
Dmerge_test.py40 x1 = np.random.random((2, 4, 5))
41 x2 = np.random.random((2, 4, 5))
42 x3 = np.random.random((2, 4, 5))
84 x1 = np.random.random((2, 4, 5))
85 x2 = np.random.random((2, 4, 5))
86 x3 = np.random.random((2, 4, 5))
99 x1 = np.random.random((2, 4, 5))
100 x2 = np.random.random((2, 4, 5))
113 x1 = np.random.random((2, 4, 5))
114 x2 = np.random.random((2, 4, 5))
[all …]
/external/eigen/unsupported/test/
Dcxx11_tensor_const.cpp18 Tensor<int, 3> random(2,3,7); in test_simple_assign() local
19 random.setRandom(); in test_simple_assign()
21 TensorMap<Tensor<const int, 3> > constant(random.data(), 2, 3, 7); in test_simple_assign()
28 VERIFY_IS_EQUAL((result(i,j,k)), random(i,j,k)); in test_simple_assign()
37 Tensor<int, 3> random(2,3,7); in test_assign_of_const_tensor() local
38 random.setRandom(); in test_assign_of_const_tensor()
40 TensorMap<Tensor<const int, 3> > constant1(random.data(), 2, 3, 7); in test_assign_of_const_tensor()
41 TensorMap<const Tensor<int, 3> > constant2(random.data(), 2, 3, 7); in test_assign_of_const_tensor()
42 const TensorMap<Tensor<int, 3> > constant3(random.data(), 2, 3, 7); in test_assign_of_const_tensor()
50 VERIFY_IS_EQUAL((result1(i,j)), random(i,j,0)); in test_assign_of_const_tensor()
[all …]
/external/python/cpython3/Lib/test/
Dtest_random.py3 import random
19 return [self.gen.random() for i in range(n)]
230 x1 = self.gen.random()
234 x2 = self.gen.random()
243 origseq = [self.gen.random() for i in range(10)]
245 restoredseq = [newgen.random() for i in range(10)]
259 self.assertEqual(int(r.random()*1000), value)
270 random.SystemRandom().random()
278 gen = random.SystemRandom()
306 cum |= int(self.gen.random() * span)
[all …]
/external/python/cpython2/Lib/test/
Dtest_random.py2 import random
17 return [self.gen.random() for i in xrange(n)]
63 val = self.gen.random()
132 x1 = self.gen.random()
136 x2 = self.gen.random()
145 origseq = [self.gen.random() for i in xrange(10)]
147 restoredseq = [newgen.random() for i in xrange(10)]
164 gen = random.WichmannHill()
174 r1 = self.gen.random()
178 self.gen.random()
[all …]
/external/tensorflow/tensorflow/contrib/framework/python/ops/
Dsort_ops_test.py41 np.random.seed(42)
43 rank = np.random.randint(1, 3)
44 shape = [np.random.randint(0, 20) for _ in range(rank)]
45 arr = np.random.random(shape)
46 sort_axis = np.random.choice(rank)
55 np.random.seed(100)
57 rank = np.random.randint(5, 15)
58 shape = [np.random.randint(1, 4) for _ in range(rank)]
59 arr = np.random.random(shape)
60 sort_axis = np.random.choice(rank)
[all …]

12345678910>>...93