MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / RndGaussian

Function RndGaussian

tensorflow/core/kernels/lrn_op_test.cc:162–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160}
161
162static double RndGaussian(random::SimplePhilox* rnd) {
163 // Box-Muller transformation.
164 // See, for example, http://www.taygeta.com/random/gaussian.html
165 double x1, x2;
166 double r;
167 do {
168 x1 = 2 * rnd->RandDouble() - 1;
169 x2 = 2 * rnd->RandDouble() - 1;
170 r = x1 * x1 + x2 * x2;
171 } while (r == 0 || r >= 1.0);
172 double w = sqrt(-2.0 * log(r) / r);
173 return x1 * w;
174}
175
176#define TCASE(NAME, DEPTH, BATCH, DEPTH_RADIUS, BIAS, ALPHA, BETA) \
177 TEST_F(LRNFloatTest, NAME) { \

Callers

nothing calls this directly

Calls 3

RandDoubleMethod · 0.80
sqrtClass · 0.70
logClass · 0.70

Tested by

no test coverage detected