Skip to content

Commit

Permalink
Update base_config attributes names in TPC (#1051)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Ofir Gordon <[email protected]>
  • Loading branch information
ofirgo and Ofir Gordon authored Apr 30, 2024
1 parent 69f81dd commit 931c9e1
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,15 @@ def clone_and_map_weights_attr_keys(self, layer_attrs_mapping: Union[Dict[str, s
"""
qc_options = copy.deepcopy(self)

for qc in qc_options.quantization_config_list:
# Extract the list of existing quantization configurations from qc_options

# Check if the base_config is already included in the quantization configuration list
# If not, add base_config to the list of configurations to update
cfgs_to_update = [cfg for cfg in qc_options.quantization_config_list]
if not any(qc_options.base_config is cfg for cfg in cfgs_to_update):
cfgs_to_update.append(qc_options.base_config)

for qc in cfgs_to_update:
if layer_attrs_mapping is None:
qc.attr_weights_configs_mapping = {}
else:
Expand Down

0 comments on commit 931c9e1

Please sign in to comment.