create_quant_retrain_model
Applicability
Product |
Supported |
|---|---|
|
|
|
|
|
|
|
|
|
Description
Performs quantization on a graph based on the configuration file (config_file), inserts activation and weight fake-quantization layers, and saves the modified network to a new model file.
Prototype
1 | retrain_ops = create_quant_retrain_model(graph, config_file, record_file) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
graph |
Input |
tf.Graph of the model for quantization. A tf.Graph. |
config_file |
Input |
User-defined QAT configuration file, which specifies the configuration of the QAT layer in the tf.Graph. A string. |
record_file |
Input |
Path of the quantization factor record file. A string. |
Returns
Returns a list of new layer name variables for QAT. The data type is list. The element type in the list is tf.Variable.
Example
1 | retrain_ops = amct.create_quant_retrain_model(graph, config_file, record_file) |