| 135 | |
| 136 | template <> |
| 137 | SimpleTensor<int16_t> convert_to_symmetric(const SimpleTensor<float> &src, const QuantizationInfo &quantization_info) |
| 138 | { |
| 139 | SimpleTensor<int16_t> dst{src.shape(), DataType::QSYMM16, 1, quantization_info}; |
| 140 | const UniformQuantizationInfo &qinfo = quantization_info.uniform(); |
| 141 | |
| 142 | #if defined(_OPENMP) |
| 143 | #pragma omp parallel for |
| 144 | #endif /* _OPENMP */ |
| 145 | for (int i = 0; i < src.num_elements(); ++i) |
| 146 | { |
| 147 | dst[i] = quantize_qsymm16(src[i], qinfo); |
| 148 | } |
| 149 | return dst; |
| 150 | } |
| 151 | |
| 152 | template <> |
| 153 | SimpleTensor<float> convert_from_symmetric(const SimpleTensor<int16_t> &src) |
nothing calls this directly
no test coverage detected