|
35 | 35 | from nncf.common.graph.patterns.manager import TargetDevice
|
36 | 36 | from nncf.common.graph.transformations.commands import TargetType
|
37 | 37 | from nncf.common.graph.utils import get_first_nodes_of_type
|
| 38 | +from nncf.common.graph.utils import get_weight_shape_legacy |
| 39 | +from nncf.common.graph.utils import get_target_dim_for_compression_legacy |
38 | 40 | from nncf.common.hardware.config import HWConfig
|
39 | 41 | from nncf.common.hardware.config import HWConfigType
|
40 | 42 | from nncf.common.hardware.config import get_hw_config_type
|
@@ -773,10 +775,10 @@ def _get_quantizer_setup(self, target_model: NNCFNetwork) -> PTQuantizerSetup:
|
773 | 775 | layer_attributes = target_node.layer_attributes
|
774 | 776 | assert isinstance(layer_attributes, WeightedLayerAttributes)
|
775 | 777 | scale_shape = get_scale_shape(
|
776 |
| - layer_attributes.get_weight_shape(), |
| 778 | + get_weight_shape_legacy(layer_attributes), |
777 | 779 | is_weights=True,
|
778 | 780 | per_channel=qconfig.per_channel,
|
779 |
| - channel_idx=layer_attributes.get_target_dim_for_compression(), |
| 781 | + channel_idx=get_target_dim_for_compression_legacy(layer_attributes), |
780 | 782 | )
|
781 | 783 | else:
|
782 | 784 | input_shape = target_model_graph.get_input_shape_for_insertion_point(insertion_point)
|
@@ -1182,7 +1184,7 @@ def is_weights(ip: PTTargetPoint) -> bool:
|
1182 | 1184 | )
|
1183 | 1185 | module_node = target_model_graph.get_node_by_name(primary_ip.target_node_name)
|
1184 | 1186 | layer_attributes = module_node.layer_attributes
|
1185 |
| - input_shape = layer_attributes.get_weight_shape() |
| 1187 | + input_shape = get_weight_shape_legacy(layer_attributes) |
1186 | 1188 | self._quantizers_input_shapes[primary_qid] = tuple(input_shape)
|
1187 | 1189 | else:
|
1188 | 1190 | primary_qid = NonWeightQuantizerId(primary_ip.target_node_name, primary_ip.input_port_id)
|
|
0 commit comments