diff --git a/python/paddle/fluid/contrib/slim/quantization/post_training_quantization.py b/python/paddle/fluid/contrib/slim/quantization/post_training_quantization.py index 46963fde7b491a3211a8f2723723f6e7c2cae272..bd8fa2a072dd496c3b16fa2158f23fe4af5fc7a5 100644 --- a/python/paddle/fluid/contrib/slim/quantization/post_training_quantization.py +++ b/python/paddle/fluid/contrib/slim/quantization/post_training_quantization.py @@ -37,8 +37,9 @@ from .adaround import run_adaround from . import utils __all__ = [ - 'PostTrainingQuantization', 'WeightQuantization', - 'PostTrainingQuantizationProgram' + 'PostTrainingQuantization', + 'WeightQuantization', + 'PostTrainingQuantizationProgram', ] _logger = get_logger(__name__, diff --git a/python/paddle/quantization/__init__.py b/python/paddle/quantization/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..77da408d8e001d4fa1dd62bf51f715d6b714084a --- /dev/null +++ b/python/paddle/quantization/__init__.py @@ -0,0 +1,25 @@ +# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from ...fluid.contrib.slim.quantization.imperative.ptq_config import PTQConfig, default_ptq_config +from ...fluid.contrib.slim.quantization.imperative.ptq_quantizer import BaseQuantizer +from ...fluid.contrib.slim.quantization.imperative.ptq_quantizer import AbsmaxQuantizer +from ...fluid.contrib.slim.quantization.imperative.ptq_quantizer import PerChannelAbsmaxQuantizer +from ...fluid.contrib.slim.quantization.imperative.ptq_quantizer import KLQuantizer +from ...fluid.contrib.slim.quantization.imperative.ptq_quantizer import HistQuantizer +from ...fluid.contrib.slim.quantization.imperative.ptq_quantizer import SUPPORT_ACT_QUANTIZERS +from ...fluid.contrib.slim.quantization.imperative.ptq_quantizer import SUPPORT_WT_QUANTIZERS +from ...fluid.contrib.slim.quantization.imperative.ptq_registry import PTQRegistry +from ...fluid.contrib.slim.quantization.imperative.ptq import ImperativePTQ +from ...fluid.contrib.slim.quantization.imperative.qat import ImperativeQuantAware diff --git a/python/paddle/static/quantization/__init__.py b/python/paddle/static/quantization/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..325fee5624bff614b5289303154cab7ead7d0a6b --- /dev/null +++ b/python/paddle/static/quantization/__init__.py @@ -0,0 +1,31 @@ +# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from ...fluid.contrib.slim.quantization.quantization_pass import QuantizationTransformPass +from ...fluid.contrib.slim.quantization.quantization_pass import QuantizationFreezePass +from ...fluid.contrib.slim.quantization.quantization_pass import ConvertToInt8Pass +from ...fluid.contrib.slim.quantization.quantization_pass import TransformForMobilePass +from ...fluid.contrib.slim.quantization.quantization_pass import OutScaleForTrainingPass +from ...fluid.contrib.slim.quantization.quantization_pass import OutScaleForInferencePass +from ...fluid.contrib.slim.quantization.quantization_pass import AddQuantDequantPass +from ...fluid.contrib.slim.quantization.quantization_pass import ReplaceFakeQuantDequantPass +from ...fluid.contrib.slim.quantization.quantization_pass import QuantWeightPass +from ...fluid.contrib.slim.quantization.quantization_pass import QuantizationTransformPassV2 +from ...fluid.contrib.slim.quantization.quantization_pass import AddQuantDequantPassV2 +from ...fluid.contrib.slim.quantization.quant_int8_mkldnn_pass import QuantInt8MkldnnPass +from ...fluid.contrib.slim.quantization.quant2_int8_mkldnn_pass import Quant2Int8MkldnnPass + +from ...fluid.contrib.slim.quantization.post_training_quantization import PostTrainingQuantization +from ...fluid.contrib.slim.quantization.post_training_quantization import PostTrainingQuantizationProgram +from ...fluid.contrib.slim.quantization.post_training_quantization import WeightQuantization