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

Function CompressibleString

tensorflow/core/lib/io/table_test.cc:62–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60 return result;
61}
62static StringPiece CompressibleString(random::SimplePhilox* rnd,
63 double compressed_fraction, size_t len,
64 string* dst) {
65 int raw = static_cast<int>(len * compressed_fraction);
66 if (raw < 1) raw = 1;
67 string raw_data;
68 RandomString(rnd, raw, &raw_data);
69
70 // Duplicate the random data until we have filled "len" bytes
71 dst->clear();
72 while (dst->size() < len) {
73 dst->append(raw_data);
74 }
75 dst->resize(len);
76 return StringPiece(*dst);
77}
78} // namespace test
79
80static void Increment(string* key) { key->push_back('\0'); }

Callers 1

TESTFunction · 0.85

Calls 5

RandomStringFunction · 0.70
clearMethod · 0.45
sizeMethod · 0.45
appendMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected