Skip to contents

Note that the model must be built first before calling this method. quantize_weights() will recursively call layer$quantize(mode) in all layers and will be skipped if the layer doesn't implement the function.

Currently only Dense and EinsumDense layers support quantization.

Usage

quantize_weights(object, mode)

Arguments

object

A Keras Model or Layer.

mode

The mode of the quantization. Only 'int8' is supported at this time.

Value

model, invisibly. Note this is just a convenience for usage with |>, the model is modified in-place.

See also

Other layer methods:
count_params()
get_config()
get_weights()
reset_state()