create_quant_retrain_model

Applicability

Product

Supported

Atlas A3 training series products/Atlas A3 inference series products

  • INT8 quantization: √

Atlas A2 training products/Atlas A2 inference products

  • INT8 quantization: √

Atlas 200I/500 A2 inference product

  • INT8 quantization: √

Atlas inference series products

  • INT8 quantization: √

Atlas training products

  • INT8 quantization: √

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)