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

Function FillRandomSkyscraper

tensorflow/lite/kernels/internal/test_util.h:87–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85// the depth) with higher values than the surround.
86template <typename T>
87void FillRandomSkyscraper(std::vector<T>* vec, int depth,
88 double middle_proportion, uint8 middle_min,
89 uint8 sides_max) {
90 for (auto base_it = std::begin(*vec); base_it != std::end(*vec);
91 base_it += depth) {
92 auto left_it = base_it + std::ceil(0.5 * depth * (1.0 - middle_proportion));
93 auto right_it =
94 base_it + std::ceil(0.5 * depth * (1.0 + middle_proportion));
95 FillRandom(base_it, left_it, std::numeric_limits<T>::min(), sides_max);
96 FillRandom(left_it, right_it, middle_min, std::numeric_limits<T>::max());
97 FillRandom(right_it, base_it + depth, std::numeric_limits<T>::min(),
98 sides_max);
99 }
100}
101
102} // namespace tflite
103#endif // TENSORFLOW_LITE_KERNELS_INTERNAL_TEST_UTIL_H_

Callers 2

TryOneSkyscraperSoftmaxFunction · 0.85

Calls 4

ceilClass · 0.85
FillRandomFunction · 0.70
minFunction · 0.50
maxFunction · 0.50

Tested by

no test coverage detected