2525from tensorflow .compiler .mlir .lite import types_pb2 as _types_pb2
2626from tensorflow .compiler .mlir .lite .metrics import converter_error_data_pb2
2727from tensorflow .compiler .mlir .lite .python import wrap_converter
28- from tensorflow .compiler .mlir .quantization .stablehlo import quantization_config_pb2
29- from tensorflow .compiler .mlir .quantization .stablehlo import quantization_options_pb2 as quant_opts_pb2
3028from tflite .python import lite_constants
3129from tflite .python import util
3230from tflite .python .convert_phase import Component
@@ -432,7 +430,6 @@ def build_conversion_flags(
432430 guarantee_all_funcs_one_use = False ,
433431 enable_mlir_variable_quantization = False ,
434432 disable_fuse_mul_and_fc = False ,
435- quantization_options : Optional [quant_opts_pb2 .QuantizationOptions ] = None ,
436433 ir_dump_dir = None ,
437434 ir_dump_pass_regex = None ,
438435 ir_dump_func_regex = None ,
@@ -441,9 +438,6 @@ def build_conversion_flags(
441438 print_ir_after = None ,
442439 print_ir_module_scope = None ,
443440 elide_elementsattrs_if_larger = None ,
444- quantization_config : Optional [
445- quantization_config_pb2 .QuantizationConfig
446- ] = None ,
447441 use_buffer_offset = False ,
448442 reduce_type_precision = False ,
449443 qdq_conversion_mode = None ,
@@ -548,11 +542,6 @@ def build_conversion_flags(
548542 graph.
549543 disable_fuse_mul_and_fc: Disable fusing input multiplication with
550544 fullyconnected operations. Useful when quantizing weights.
551- quantization_options: [Deprecated] Config to indicate quantization options
552- of each components (ex: weight, bias, activation). This can be a preset
553- method or a custom method, and allows finer, modular control. This option
554- will override any other existing quantization flags. We plan on gradually
555- migrating all quantization-related specs into this option.
556545 ir_dump_dir: A string specifying the target directory to output MLIR dumps
557546 produced during conversion. If populated, enables MLIR dumps.
558547 ir_dump_pass_regex: A string containing a regular expression for filtering
@@ -570,8 +559,6 @@ def build_conversion_flags(
570559 operation when printing IR for print_ir_[before|after].
571560 elide_elementsattrs_if_larger: An int, if specified elides ElementsAttrs
572561 with '...' that have more elements than the given upper limit.
573- quantization_config: Configures the StableHLO Quantizer. See the comments in
574- `QuantizationConfig` protobuf definition for details.
575562 use_buffer_offset: Force the model use buffer_offset & buffer_size fields
576563 instead of data. i.e. store the constant tensor and custom op binaries
577564 outside of Flatbuffers
@@ -682,10 +669,6 @@ def build_conversion_flags(
682669 enable_mlir_variable_quantization
683670 )
684671 conversion_flags .disable_fuse_mul_and_fc = disable_fuse_mul_and_fc
685- if quantization_options : # Deprecated
686- conversion_flags .quantization_options .CopyFrom (quantization_options )
687- if quantization_config :
688- conversion_flags .quantization_config .CopyFrom (quantization_config )
689672
690673 # Transfer debug options. Check for existence before populating in order to
691674 # leverage defaults specified in proto definition.
0 commit comments