View source on GitHub
|
Structured summary of a single model.quantize() call.
tf.keras.quantizers.QuantizationReport(
mode=None
)
A report is returned by model.quantize() and also stored on the model as
model._quantization_report. It records, per leaf layer, whether the layer
was quantized or skipped (with the reason).
The possible skip reasons are available as class attributes on
QuantizationReport (SKIP_NO_SUPPORT, SKIP_FILTERED,
SKIP_ALREADY_QUANTIZED, SKIP_OUTSIDE_STRUCTURE).
Args | |
|---|---|
mode
|
The resolved quantization mode for the call (e.g. "int8").
Defaults to None.
|
Methods
add_quantized
add_quantized(
path, mode, scheme
)
add_skipped
add_skipped(
path, reason
)
render
render()
Return the full report as a multi-line string.
skipped_by_reason
skipped_by_reason(
reason
)
Return the list of layer paths that were skipped for reason.
summary_warning
summary_warning(
max_examples=5
)
Return a single warning message, or None if nothing to warn about.
This replaces the previous behavior of emitting one UserWarning per
non-quantizable leaf layer with a single message that reports counts
and up to max_examples example layer names.
Class Variables | |
|---|---|
| SKIP_ALREADY_QUANTIZED |
'already quantized'
|
| SKIP_FILTERED |
'filtered out'
|
| SKIP_NO_SUPPORT |
'no quantize support'
|
| SKIP_OUTSIDE_STRUCTURE |
'outside quantization structure'
|
View source on GitHub