| 149 | template <typename AccumScalar, typename DstScalar, |
| 150 | QuantizationFlavor quantization_flavor> |
| 151 | void ValidateGemmParams( |
| 152 | const GemmParams<AccumScalar, DstScalar, quantization_flavor>& params) { |
| 153 | // Guard consistency of the quantized multiplier fields. |
| 154 | if (quantization_flavor == QuantizationFlavor::kFloatingPoint) { |
| 155 | TFLITE_DCHECK(!params.multiplier_fixedpoint); |
| 156 | TFLITE_DCHECK(!params.multiplier_exponent); |
| 157 | TFLITE_DCHECK(!params.multiplier_fixedpoint_perchannel); |
| 158 | TFLITE_DCHECK(!params.multiplier_exponent_perchannel); |
| 159 | } else if (quantization_flavor == |
| 160 | QuantizationFlavor::kIntegerWithUniformMultiplier) { |
| 161 | TFLITE_DCHECK(params.multiplier_fixedpoint); |
| 162 | // Nothing to check about multiplier_exponent |
| 163 | TFLITE_DCHECK(!params.multiplier_fixedpoint_perchannel); |
| 164 | TFLITE_DCHECK(!params.multiplier_exponent_perchannel); |
| 165 | } else if (quantization_flavor == |
| 166 | QuantizationFlavor::kIntegerWithPerRowMultiplier) { |
| 167 | TFLITE_DCHECK(!params.multiplier_fixedpoint); |
| 168 | TFLITE_DCHECK(!params.multiplier_exponent); |
| 169 | TFLITE_DCHECK(params.multiplier_fixedpoint_perchannel); |
| 170 | TFLITE_DCHECK(params.multiplier_exponent_perchannel); |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | namespace detail { |
| 175 |
no outgoing calls
no test coverage detected