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

Function GenerateCsv

tensorflow/lite/testing/generate_testspec.cc:28–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26
27template <typename T>
28void GenerateCsv(const std::vector<int>& shape, float min, float max,
29 string* out) {
30 auto random_float = [](float min, float max) {
31 static unsigned int seed;
32 return min + (max - min) * static_cast<float>(rand_r(&seed)) / RAND_MAX;
33 };
34
35 std::function<T(int)> random_t = [&](int) {
36 return static_cast<T>(random_float(min, max));
37 };
38 std::vector<T> data = GenerateRandomTensor(shape, random_t);
39 *out = Join(data.data(), data.size(), ",");
40}
41
42std::vector<string> GenerateInputValues(
43 const std::vector<string>& input_layer,

Callers

nothing calls this directly

Calls 4

GenerateRandomTensorFunction · 0.70
JoinFunction · 0.70
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected