Browse Source

Pre Merge pull request !16122 from Erpim/master

pull/16122/MERGE
Erpim Gitee 5 years ago
parent
commit
7f4e451838
2 changed files with 4 additions and 3 deletions
  1. +4
    -2
      mindspore/compression/quant/qat.py
  2. +0
    -1
      tests/st/quantization/lenet_quant/test_lenet_quant.py

+ 4
- 2
mindspore/compression/quant/qat.py View File

@@ -524,12 +524,14 @@ class QuantizationAwareTraining(Quantizer):
r"""
Set network's quantization strategy, this function is currently only valid for `LEARNED_SCALE`
optimize_option.
Input:

Inputs:
network (Cell): input network
strategy (List): the quantization strategy for layers that need to be quantified (eg. [[8], [8],
..., [6], [4], [8]]), currently only the quant_dtype for weights of the dense layer and the
convolution layer is supported.
Output:

Outputs:
network (Cell)
"""
if OptimizeOption.LEARNED_SCALE not in self.optimize_option:


+ 0
- 1
tests/st/quantization/lenet_quant/test_lenet_quant.py View File

@@ -79,7 +79,6 @@ def eval_lenet():
print("============== Starting Testing ==============")
acc = model.eval(ds_eval, dataset_sink_mode=True)
print("============== {} ==============".format(acc))
assert acc['Accuracy'] > 0.98


def train_lenet_quant(optim_option="QAT"):


Loading…
Cancel
Save