Make some "experimental" feature flag private
And also removes all the related api documentation. PiperOrigin-RevId: 303006102 Change-Id: Id135e802e6007e98f30e48a8232a51f7150c7aaa
This commit is contained in:
parent
b6016957b3
commit
e6895b3648
tensorflow/lite/python
@ -174,8 +174,8 @@ class TFLiteConverterBase(object):
|
||||
self.optimizations = []
|
||||
self.representative_dataset = None
|
||||
self.experimental_new_converter = _USE_EXPERIMENTAL_NEW_CONVERTER
|
||||
self.experimental_new_quantizer = False
|
||||
self.experimental_calibrate_only = False
|
||||
self._experimental_new_quantizer = False
|
||||
self._experimental_calibrate_only = False
|
||||
# The 'GraphDebugInfo' contains the stack traces of all the original nodes
|
||||
# in the `GraphDef` to the converter.
|
||||
self._debug_info = None
|
||||
@ -259,7 +259,7 @@ class TFLiteConverterBase(object):
|
||||
inference_output_type):
|
||||
allow_float = not self._is_int8_target_required()
|
||||
calibrate_quantize = _calibrator.Calibrator(result)
|
||||
if self.experimental_calibrate_only:
|
||||
if self._experimental_calibrate_only:
|
||||
return calibrate_quantize.calibrate(self.representative_dataset.input_gen)
|
||||
else:
|
||||
return calibrate_quantize.calibrate_and_quantize(
|
||||
@ -317,11 +317,6 @@ class TFLiteConverterV2(TFLiteConverterBase):
|
||||
dataset to evaluate different optimizations.
|
||||
experimental_new_converter: Experimental flag, subject to change.
|
||||
Enables MLIR-based conversion instead of TOCO conversion.
|
||||
experimental_new_quantizer: Experimental flag, subject to change.
|
||||
Enables MLIR-based post-training quantization.
|
||||
experimental_calibrate_only: Experimental flag, subject to change.
|
||||
Calibrates the converted model with representative dataset, but not
|
||||
quantize it.
|
||||
Example usage:
|
||||
|
||||
```python
|
||||
@ -609,11 +604,6 @@ class TFLiteConverter(TFLiteConverterBase):
|
||||
the dataset to evaluate different optimizations.
|
||||
experimental_new_converter: Experimental flag, subject to change.
|
||||
Enables MLIR-based conversion instead of TOCO conversion.
|
||||
experimental_new_quantizer: Experimental flag, subject to change.
|
||||
Enables MLIR-based post-training quantization.
|
||||
experimental_calibrate_only: Experimental flag, subject to change.
|
||||
Calibrates the converted model with representative dataset, but not
|
||||
quantize it.
|
||||
Example usage:
|
||||
|
||||
```python
|
||||
|
@ -296,11 +296,11 @@ class FromConcreteFunctionTest(TestModels):
|
||||
quantized_converter.representative_dataset = calibration_gen
|
||||
|
||||
# default quantizer
|
||||
quantized_converter.experimental_new_quantizer = False
|
||||
quantized_converter._experimental_new_quantizer = False
|
||||
old_tflite = quantized_converter.convert()
|
||||
|
||||
# new quantizer
|
||||
quantized_converter.experimental_new_quantizer = True
|
||||
quantized_converter._experimental_new_quantizer = True
|
||||
new_tflite = quantized_converter.convert()
|
||||
|
||||
for _ in range(5):
|
||||
|
Loading…
Reference in New Issue
Block a user