@@ -167,16 +167,19 @@ LogicalResult verifyQuantizationOp(Operation *op, QuantizedType quantizedType,
167
167
return op->emitError (
168
168
" expressed type in quantized type expected to match float type" );
169
169
170
- // Veriy integrity of per-axis quantization information, if present.
170
+ // Verify integrity of per-axis quantization information, if present.
171
171
if (auto quantizedPerAxisType =
172
172
dyn_cast<UniformQuantizedPerAxisType>(quantizedType)) {
173
173
return verifyPerAxisQuantization (op, quantizedPerAxisType, containerType);
174
- } else if (auto quantizedSubChannelType =
175
- dyn_cast<UniformQuantizedSubChannelType>(quantizedType)) {
174
+ }
175
+
176
+ if (auto quantizedSubChannelType =
177
+ dyn_cast<UniformQuantizedSubChannelType>(quantizedType)) {
176
178
return verifySubChannelQuantization (op, quantizedSubChannelType,
177
179
containerType);
178
180
}
179
181
182
+ // At this point the type is UniformQuantizedType
180
183
return success ();
181
184
}
182
185
@@ -268,14 +271,18 @@ LogicalResult StorageCastOp::verify() {
268
271
// the quantization type may appear in the input or the result, their tensor
269
272
// shapes are guaranteed to be identical at this point.
270
273
if (auto quantizedPerAxisType =
271
- dyn_cast<UniformQuantizedPerAxisType>(quantizedType))
274
+ dyn_cast<UniformQuantizedPerAxisType>(quantizedType)) {
272
275
return verifyPerAxisQuantization (*this , quantizedPerAxisType,
273
276
getInput ().getType ());
274
- else if (auto quantizedSunChannelType =
275
- dyn_cast<UniformQuantizedSubChannelType>(quantizedType))
277
+ }
278
+
279
+ if (auto quantizedSunChannelType =
280
+ dyn_cast<UniformQuantizedSubChannelType>(quantizedType)) {
276
281
return verifySubChannelQuantization (*this , quantizedSunChannelType,
277
282
getInput ().getType ());
283
+ }
278
284
285
+ // At this point the type is UniformQuantizedType
279
286
return success ();
280
287
}
281
288
0 commit comments