tf.keras.quantizers.AbsMaxQuantizer
Stay organized with collections
Save and categorize content based on your preferences.
Inherits From: Quantizer
tf.keras.quantizers.AbsMaxQuantizer(
axis,
value_range=(-127, 127),
epsilon=backend.epsilon(),
output_dtype='int8'
)
Methods
from_config
View source
@classmethod
from_config(
config
)
Creates a quantizer from its config.
This method is the reverse of get_config
,
capable of instantiating the same quantizer from the config
dictionary.
This method is used by Keras model_to_estimator
, saving and
loading models to HDF5 formats, Keras model cloning, some visualization
utilities, and exporting models to and from JSON.
Args |
config
|
A Python dictionary, typically the output of get_config.
|
Returns |
A quantizer instance.
|
get_config
View source
get_config()
Returns the config of the quantizer.
An quantizer config is a Python dictionary (serializable)
containing all configuration parameters of the quantizer.
The same quantizer can be reinstantiated later
(without any saved state) from this configuration.
This method is optional if you are just training and executing models,
exporting to and from SavedModels, or using weight checkpoints.
This method is required for Keras model_to_estimator
, saving and
loading models to HDF5 formats, Keras model cloning, some visualization
utilities, and exporting models to and from JSON.
Returns |
Python dictionary.
|
__call__
View source
__call__(
x
)
Compute a quantized output from an input tensor.
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 2024-06-07 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-06-07 UTC."],[],[],null,["# tf.keras.quantizers.AbsMaxQuantizer\n\n\u003cbr /\u003e\n\n|----------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/keras-team/keras/tree/v3.3.3/keras/src/quantizers/quantizers.py#L78-L106) |\n\nInherits From: [`Quantizer`](../../../tf/keras/Quantizer) \n\n tf.keras.quantizers.AbsMaxQuantizer(\n axis,\n value_range=(-127, 127),\n epsilon=backend.epsilon(),\n output_dtype='int8'\n )\n\nMethods\n-------\n\n### `from_config`\n\n[View source](https://github.com/keras-team/keras/tree/v3.3.3/keras/src/quantizers/quantizers.py#L19-L37) \n\n @classmethod\n from_config(\n config\n )\n\nCreates a quantizer from its config.\n\nThis method is the reverse of `get_config`,\ncapable of instantiating the same quantizer from the config\ndictionary.\n\nThis method is used by Keras `model_to_estimator`, saving and\nloading models to HDF5 formats, Keras model cloning, some visualization\nutilities, and exporting models to and from JSON.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|----------|----------------------------------------------------------|\n| `config` | A Python dictionary, typically the output of get_config. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|---|\n| A quantizer instance. ||\n\n\u003cbr /\u003e\n\n### `get_config`\n\n[View source](https://github.com/keras-team/keras/tree/v3.3.3/keras/src/quantizers/quantizers.py#L100-L106) \n\n get_config()\n\nReturns the config of the quantizer.\n\nAn quantizer config is a Python dictionary (serializable)\ncontaining all configuration parameters of the quantizer.\nThe same quantizer can be reinstantiated later\n(without any saved state) from this configuration.\n\nThis method is optional if you are just training and executing models,\nexporting to and from SavedModels, or using weight checkpoints.\n\nThis method is required for Keras `model_to_estimator`, saving and\nloading models to HDF5 formats, Keras model cloning, some visualization\nutilities, and exporting models to and from JSON.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|---|\n| Python dictionary. ||\n\n\u003cbr /\u003e\n\n### `__call__`\n\n[View source](https://github.com/keras-team/keras/tree/v3.3.3/keras/src/quantizers/quantizers.py#L94-L98) \n\n __call__(\n x\n )\n\nCompute a quantized output from an input tensor."]]