| 185 | |
| 186 | template <typename T> |
| 187 | void QuantizeAndPopulate(int index, const std::vector<float>& data) { |
| 188 | TfLiteTensor* t = interpreter_->tensor(index); |
| 189 | auto q = Quantize<T>(data, t->params.scale, t->params.zero_point); |
| 190 | PopulateTensor(index, 0, q.data(), q.data() + q.size()); |
| 191 | } |
| 192 | |
| 193 | void SymmetricQuantizeAndPopulate(int index, const std::vector<float>& data) { |
| 194 | std::vector<int8_t> q = QuantizeTensor(index, data); |