View source on GitHub |
tf.keras.Quantizer(
output_dtype='int8'
)
Methods
from_config
@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
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__
__call__(
x
)
Compute a quantized output from an input tensor.