| 103 | typename std::enable_if<IsFloatingPointIterator<FloatIt>::value, int>::type=0 // Makes sure fp iterator is valid. |
| 104 | > |
| 105 | std::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 | |
| 120 | template<typename T> |
| 121 | std::vector<T> QuantizedVector(const std::vector<float>& array, float qScale = 1.f, int32_t qOffset = 0) |