@@ -167,16 +167,19 @@ LogicalResult verifyQuantizationOp(Operation *op, QuantizedType quantizedType,
167167 return op->emitError (
168168 " expressed type in quantized type expected to match float type" );
169169
170- // Veriy integrity of per-axis quantization information, if present.
170+ // Verify integrity of per-axis quantization information, if present.
171171 if (auto quantizedPerAxisType =
172172 dyn_cast<UniformQuantizedPerAxisType>(quantizedType)) {
173173 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)) {
176178 return verifySubChannelQuantization (op, quantizedSubChannelType,
177179 containerType);
178180 }
179181
182+ // At this point the type is UniformQuantizedType
180183 return success ();
181184}
182185
@@ -268,14 +271,18 @@ LogicalResult StorageCastOp::verify() {
268271 // the quantization type may appear in the input or the result, their tensor
269272 // shapes are guaranteed to be identical at this point.
270273 if (auto quantizedPerAxisType =
271- dyn_cast<UniformQuantizedPerAxisType>(quantizedType))
274+ dyn_cast<UniformQuantizedPerAxisType>(quantizedType)) {
272275 return verifyPerAxisQuantization (*this , quantizedPerAxisType,
273276 getInput ().getType ());
274- else if (auto quantizedSunChannelType =
275- dyn_cast<UniformQuantizedSubChannelType>(quantizedType))
277+ }
278+
279+ if (auto quantizedSunChannelType =
280+ dyn_cast<UniformQuantizedSubChannelType>(quantizedType)) {
276281 return verifySubChannelQuantization (*this , quantizedSunChannelType,
277282 getInput ().getType ());
283+ }
278284
285+ // At this point the type is UniformQuantizedType
279286 return success ();
280287}
281288
0 commit comments