The final step before building an AIE-ML inference solution is to obtain quantized weights for the trained MNIST ConvNet classifier. For simplicity in this tutorial, choose a bfloat16 implementation because quantization is straightforward. Each weight and bias shares the same exponent and uses an 8-bit quantized mantissa, instead of the 24-bit mantissa in full-precision Keras floating-point values. The following code extracts the weights and biases from the Keras model, quantizes them to bfloat16 and then saves them in files for validating each layer of the network to be designed in the following AIE-ML.