(data, scale, zero)
| 172 | |
| 173 | |
| 174 | def quantize_with_scale_and_zero(data, scale, zero): |
| 175 | np_data = np.array(data).astype(float) |
| 176 | output = np.round(zero + np_data / scale).astype(np.int32) |
| 177 | quantized_data = QuantizedData() |
| 178 | quantized_data.data = output |
| 179 | quantized_data.scale = scale |
| 180 | quantized_data.zero = zero |
| 181 | return quantized_data |
| 182 | |
| 183 | |
| 184 | def quantize_int8(data): |
nothing calls this directly
no test coverage detected