tf.keras.quantizers.abs_max_quantize
Stay organized with collections
Save and categorize content based on your preferences.
Quantizes the input tensor using the absolute maximum quantization scheme.
tf.keras.quantizers.abs_max_quantize(
inputs,
axis,
value_range=(-127, 127),
dtype='int8',
epsilon=backend.epsilon(),
to_numpy=False
)
Args |
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.
|
Returns |
|
A tuple of the quantized tensor and the scale.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2026-10-31 UTC.
[null,null,["Last updated 2026-10-31 UTC."],[],[]]