Total quantization error on test data
| 50 | |
| 51 | // Total quantization error on test data |
| 52 | static float total_quantization_error(const ggml_type_traits * qfns, const ggml_type_traits_cpu * qfns_cpu, size_t test_size, const float * test_data) { |
| 53 | std::vector<uint8_t> tmp_q(2*test_size); |
| 54 | std::vector<float> tmp_out(test_size); |
| 55 | |
| 56 | qfns_cpu->from_float(test_data, tmp_q.data(), test_size); |
| 57 | qfns->to_float(tmp_q.data(), tmp_out.data(), test_size); |
| 58 | return array_rmse(test_data, tmp_out.data(), test_size); |
| 59 | } |
| 60 | |
| 61 | // Total quantization error on test data |
| 62 | static float reference_quantization_error(const ggml_type_traits * qfns, const ggml_type_traits_cpu * qfns_cpu, size_t test_size, const float * test_data) { |
no test coverage detected