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

Function MakeRandomBitmap

tensorflow/core/lib/core/bitmap_test.cc:29–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27size_t NextSize(size_t n) { return n + ((n < 75) ? 1 : 25); }
28
29static void MakeRandomBitmap(random::SimplePhilox* rnd, Bitmap* bitmap) {
30 size_t n = rnd->Uniform(200);
31 bitmap->Reset(n);
32 for (size_t i = 0; i < n; i++) {
33 if (rnd->OneIn(2)) bitmap->set(i);
34 }
35}
36
37TEST(BitmapTest, Basic) {
38 for (size_t n = 0; n < 200; n = NextSize(n)) {

Callers 1

TESTFunction · 0.85

Calls 4

UniformMethod · 0.80
OneInMethod · 0.80
ResetMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected