MCPcopy Create free account
hub / github.com/Samsung/ONE / update_qparam

Method update_qparam

compiler/record-minmax/src/MinMaxComputer.cpp:25–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23{
24
25void PercentileComputer::update_qparam(
26 const std::unordered_map<const luci::CircleNode *, MinMaxVectors> *minmax_map)
27{
28 if (minmax_map == nullptr)
29 throw std::invalid_argument("minmax_map is nullptr");
30
31 for (auto iter = minmax_map->begin(); iter != minmax_map->end(); ++iter)
32 {
33 auto node = iter->first;
34 auto minmax = iter->second;
35
36 auto min = getNthPercentile(minmax.min_vector, _min_percentile);
37 auto max = getNthPercentile(minmax.max_vector, _max_percentile);
38
39 auto quantparam = std::make_unique<luci::CircleQuantParam>();
40 quantparam->min.push_back(min);
41 quantparam->max.push_back(max);
42
43 assert(node->quantparam() == nullptr);
44
45 auto mutable_node = const_cast<luci::CircleNode *>(node);
46 mutable_node->quantparam(std::move(quantparam));
47 }
48}
49
50void MovingAvgComputer::update_qparam(
51 const std::unordered_map<const luci::CircleNode *, MinMaxVectors> *minmax_map)

Callers 6

profileRawDataMethod · 0.80
profileDataMethod · 0.80
profileDataInParallelMethod · 0.80
TESTFunction · 0.80

Calls 6

getMovingAverageFunction · 0.85
push_backMethod · 0.80
getNthPercentileFunction · 0.70
beginMethod · 0.45
endMethod · 0.45
quantparamMethod · 0.45

Tested by 1

TESTFunction · 0.64