Skip to content

Commit 9f7f5a2

Browse files
author
Aleksei Kashapov
authored
Fix incorrect arg in test after #1905 (#1937)
### Changes Add inference_graph in `_get_ignored_names` ### Reason for changes Fix pre-commit after merge #1905 ### Related tickets No ### Tests No
1 parent 072504c commit 9f7f5a2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/post_training/test_templates/test_ptq_params.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# limitations under the License.
1111
from abc import abstractmethod
1212
from collections import Counter
13+
from copy import deepcopy
1314
from typing import Dict
1415

1516
import pytest
@@ -27,6 +28,7 @@
2728
from nncf.quantization.advanced_parameters import OverflowFix
2829
from nncf.quantization.algorithms.min_max.algorithm import MinMaxQuantization
2930
from nncf.quantization.algorithms.post_training.algorithm import PostTrainingQuantization
31+
from nncf.quantization.passes import transform_to_inference_graph
3032
from nncf.quantization.range_estimator import RangeEstimatorParametersSet
3133
from nncf.scopes import IgnoredScope
3234
from tests.common.quantization.metatypes import Conv2dTestMetatype
@@ -262,13 +264,14 @@ def test_quantization_points_overflow_fix(self, overflow_fix, affected_target_po
262264
@pytest.mark.parametrize("validate_scopes", (True, False))
263265
def test_validate_scope(self, test_params, validate_scopes):
264266
nncf_graph = test_params["test_model_type_pass"]["nncf_graph"]
267+
inference_nncf_graph = transform_to_inference_graph(deepcopy(nncf_graph), [])
265268
ignored_patterns = test_params["test_model_type_pass"]["ignored_patterns"]
266269
algo = MinMaxQuantization(
267270
ignored_scope=IgnoredScope(names=["some_node"], validate=validate_scopes),
268271
)
269272
algo._backend_entity = self.get_algo_backend()
270273
if validate_scopes:
271274
with pytest.raises(RuntimeError, match="Ignored nodes with name"):
272-
algo._get_ignored_names(nncf_graph, ignored_patterns)
275+
algo._get_ignored_names(nncf_graph, inference_nncf_graph, ignored_patterns)
273276
else:
274-
algo._get_ignored_names(nncf_graph, ignored_patterns)
277+
algo._get_ignored_names(nncf_graph, inference_nncf_graph, ignored_patterns)

0 commit comments

Comments
 (0)