Skip to content

Commit c7e6209

Browse files
author
yarden-sony
committed
add test: wip
1 parent a8c2b23 commit c7e6209

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tests_pytest/common_tests/unit_tests/core/graph/test_node_quantization.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,17 @@
2424
OpQuantizationConfig, AttributeQuantizationConfig, Signedness
2525
from mct_quantizers import QuantizationMethod
2626

27+
2728
class PreservingNode:
2829
""" Only needed for repr(node) to work. """
2930
pass
3031

32+
3133
class NoActivationQuantNode:
3234
""" Only needed for repr(node) to work. """
3335
pass
3436

37+
3538
class TestSetNodeQuantizationConfig:
3639

3740
@staticmethod
@@ -80,13 +83,13 @@ def test_node_quantization_by_next_nodes(self, fw_info_mock):
8083
edge_list=[Edge(first_node, preserving_node, 0, 0),
8184
Edge(preserving_node, no_quant_node, 0, 0)])
8285

83-
first_node_config_kwargs = {"activation_n_bits": 8,
86+
first_node_config_kwargs = {"activation_n_bits": 16,
8487
"supported_input_activation_n_bits": [8, 16],
8588
"enable_activation_quantization": True,
8689
"quantization_preserving": False}
8790

8891
preserving_node_config_kwargs = {"activation_n_bits": 8,
89-
"supported_input_activation_n_bits": [8],
92+
"supported_input_activation_n_bits": [8, 16],
9093
"enable_activation_quantization": False,
9194
"quantization_preserving": True}
9295

@@ -115,8 +118,7 @@ def test_node_quantization_by_next_nodes(self, fw_info_mock):
115118
set_quantization_configs_to_node(preserving_node, graph, QuantizationConfig(), fw_info_mock, fqc)
116119
set_quantization_configs_to_node(no_quant_node, graph, QuantizationConfig(), fw_info_mock, fqc)
117120

118-
# assert not first_node.is_quantization_preserving() and first_node.is_activation_quantization_enabled()
119-
assert preserving_node.is_quantization_preserving() and preserving_node.is_activation_quantization_enabled()
121+
assert not first_node.is_quantization_preserving() and first_node.is_activation_quantization_enabled()
122+
assert preserving_node.is_quantization_preserving() and not preserving_node.is_activation_quantization_enabled()
120123
assert not no_quant_node.is_quantization_preserving() and not no_quant_node.is_activation_quantization_enabled()
121124

122-
print("a")

0 commit comments

Comments
 (0)