tf.keras.quantizers.abs_max_quantize

Quantizes the input tensor using the absolute maximum quantization scheme.

inputs Input tensor to quantize.
axis Axis along which to compute the quantization range.
value_range Tuple of the minimum and maximum values of the quantization range.
dtype Data type of the quantized output.
epsilon Small value to avoid division by zero.
to_numpy Whether to perform the quantization in numpy. This performs the computation on the host CPU and can be useful for saving memory on the device. If False, the computation is performed on the device.

A tuple of the quantized tensor and the scale.