tf.keras.quantizers.Int4QuantizationConfig
Stay organized with collections
Save and categorize content based on your preferences.
Int4 quantization config.
Inherits From: QuantizationConfig
tf.keras.quantizers.Int4QuantizationConfig(
weight_quantizer=None,
activation_quantizer='default',
block_size=128
)
Args |
weight_quantizer
|
Quantizer for weights.
|
activation_quantizer
|
Quantizer for activations. If "default", uses
AbsMaxQuantizer with axis=-1.
|
block_size
|
Size of groups along the input dimension for sub-channel
quantization. If a positive integer, uses sub-channel quantization
with ceil(input_dim / block_size) groups. If None or -1,
uses per-channel quantization (one scale per output channel).
Default: 128 (sub-channel with 128-element groups).
|
Methods
activation_quantizer_or_default
View source
@staticmethod
activation_quantizer_or_default(
config, default
)
from_config
View source
@classmethod
from_config(
config
)
get_config
View source
get_config()
weight_quantizer_or_default
View source
@staticmethod
weight_quantizer_or_default(
config, default
)
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-11-04 UTC.
[null,null,["Last updated 2026-11-04 UTC."],[],[]]