diff --git a/tests/common/quantization/test_quantizer_propagation_solver.py b/tests/common/quantization/test_quantizer_propagation_solver.py index dc065a2e7e2..1f7495bd1c4 100644 --- a/tests/common/quantization/test_quantizer_propagation_solver.py +++ b/tests/common/quantization/test_quantizer_propagation_solver.py @@ -1839,3 +1839,28 @@ def test_quantizers_are_not_set_up_for_integer_inputs(self, ip_graph_with_int_ed assert double_input_pq.current_location_node_key == InsertionPointGraph.get_pre_hook_node_key( "5 /E_0", input_port_id=1 ) + + +def test_metatypes_to_ignore(mocker): + # pylint: disable=protected-access + NOT_IGNORED_METATYHPE = "not_ignored_metatype" + IGNORED_METATYPE = "target_metatype" + + nncf_graph = NNCFGraph() + nodes = [] + for node_name, node_metatype in zip("ABC", [NOT_IGNORED_METATYHPE, IGNORED_METATYPE, NOT_IGNORED_METATYHPE]): + nodes.append(nncf_graph.add_nncf_node(node_name, node_name, node_metatype=node_metatype)) + for idx in range(1, len(nodes)): + nncf_graph.add_edge_between_nncf_nodes( + nodes[idx - 1].node_id, nodes[idx].node_id, [1, 1, 1, 1], 0, 0, Dtype.FLOAT + ) + ip_graph = InsertionPointGraph(nncf_graph=nncf_graph, weight_modifiable_node_names=["A", "B", "C"]) + + solver = QuantizerPropagationSolver( + metatypes_to_ignore=[IGNORED_METATYPE], + ) + solver._add_node_to_ignored = mocker.MagicMock() + solver.run_on_ip_graph(ip_graph) + + solver._add_node_to_ignored.assert_called_once() + assert "1 B" in solver._add_node_to_ignored.call_args[0]