Skip to content

Commit e437274

Browse files
committed
[NNCF] Experimental common backend: Replace (openvinotoolkit#3249)
Changes: Call to following class method in nncf/common/graph/layer_attributes.py was replaced with call to its corresponding self-contained legacy function in nncf/common/graph/utils.py: - layer_attributes.get_target_dim_for_compression -> get_target_dim_for_compression_legacy( layer_attributes: WeightedLayerAttributes) Locations in /nncf/experimental/common/pruning/ - nodes_grouping.py Reason for changes: (openvinotoolkit#3249) Torch and Tensorflow backend-specific methods need to be removed from common layer attributes and all related calls need to be replaced by their corresponding legacy function calls
1 parent 433ff6b commit e437274

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

nncf/experimental/common/pruning/nodes_grouping.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from nncf.common.graph.graph import NNCFNode
1919
from nncf.common.graph.layer_attributes import ConvolutionLayerAttributes
2020
from nncf.common.graph.layer_attributes import LinearLayerAttributes
21+
from nncf.common.graph.utils import get_target_dim_for_compression_legacy
2122
from nncf.common.pruning.mask_propagation import MaskPropagationAlgorithm
2223
from nncf.common.pruning.utils import PruningOperationsMetatypeRegistry
2324
from nncf.experimental.common.graph.netron import save_for_netron
@@ -76,7 +77,7 @@ def get_pruning_groups(
7677
roots = {}
7778
for node in all_nodes_to_prune:
7879
assert isinstance(node.layer_attributes, (LinearLayerAttributes, ConvolutionLayerAttributes))
79-
pruning_dim = node.layer_attributes.get_target_dim_for_compression()
80+
pruning_dim = get_target_dim_for_compression_legacy(node.layer_attributes)
8081
output_tensors_shapes = [x.tensor_shape for x in graph.get_output_edges(node)]
8182
assert not len(set(output_tensors_shapes)) > 1, node.node_name
8283
output_tensors_shape = output_tensors_shapes[0]

0 commit comments

Comments
 (0)