MCPcopy Create free account
hub / github.com/ARM-software/armnn / QuantizedVector

Function QuantizedVector

include/armnnUtils/QuantizeHelper.hpp:105–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103typename std::enable_if<IsFloatingPointIterator<FloatIt>::value, int>::type=0 // Makes sure fp iterator is valid.
104>
105std::vector<T> QuantizedVector(FloatIt first, FloatIt last, float qScale, int32_t qOffset)
106{
107 std::vector<T> quantized;
108 quantized.reserve(armnn::numeric_cast<size_t>(std::distance(first, last)));
109
110 for (auto it = first; it != last; ++it)
111 {
112 auto f = *it;
113 T q = SelectiveQuantize<T>(f, qScale, qOffset);
114 quantized.push_back(q);
115 }
116
117 return quantized;
118}
119
120template<typename T>
121std::vector<T> QuantizedVector(const std::vector<float>& array, float qScale = 1.f, int32_t qOffset = 0)

Callers

nothing calls this directly

Calls 4

push_backMethod · 0.80
reserveMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected