<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/quantizers/quantizers.py#L19-L66) |

#### View aliases


**Main aliases**

[`tf.keras.quantizers.Quantizer`](https://www.tensorflow.org/api_docs/python/tf/keras/Quantizer)
**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.keras.Quantizer`](https://www.tensorflow.org/api_docs/python/tf/keras/Quantizer)

<br />

    tf.keras.Quantizer(
        output_dtype='int8'
    )

## Methods

### `from_config`

[View source](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/quantizers/quantizers.py#L28-L46)

    @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.

<br />

<br />

<br />

| Args ||
|---|---|
| `config` | A Python dictionary, typically the output of get_config. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| A quantizer instance. ||

<br />

### `get_config`

[View source](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/quantizers/quantizers.py#L48-L66)

    get_config()

Returns the config of the quantizer.

A 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.

<br />

<br />

<br />

| Returns ||
|---|---|
| Python dictionary. ||

<br />

### `__call__`

[View source](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/quantizers/quantizers.py#L24-L26)

    __call__(
        x
    )

Compute a quantized output from an input tensor.