message: Reject quantized type tensor with zero scales in flatbuffer importer.
diff: @@ -152,6 +152,14 @@ StatusOr<QuantizedType> GetQuantizedType(const TensorT& tensor, Builder builder,
  uint32_t flags =
  is_signed ? mlir::quant::QuantizationFlags::FlagValue::Signed : 0;
  + // Rejects if quantized tensors have zero scales.
  + for (float scale : quant_params.scale) {
  + if (scale == 0) {
  + return errors::InvalidArgument(
  + "Quantized tensors must have non-zero scales");
  + }
  + }
  +
  // Scale size can't be zero as it is checked before.
  if (quant_params.scale.size() != 1) {
  llvm::SmallVector<double, 4> scales(quant_params.scale.begin(),
  