|
24 | 24 | OpQuantizationConfig, AttributeQuantizationConfig, Signedness |
25 | 25 | from mct_quantizers import QuantizationMethod |
26 | 26 |
|
| 27 | + |
27 | 28 | class PreservingNode: |
28 | 29 | """ Only needed for repr(node) to work. """ |
29 | 30 | pass |
30 | 31 |
|
| 32 | + |
31 | 33 | class NoActivationQuantNode: |
32 | 34 | """ Only needed for repr(node) to work. """ |
33 | 35 | pass |
34 | 36 |
|
| 37 | + |
35 | 38 | class TestSetNodeQuantizationConfig: |
36 | 39 |
|
37 | 40 | @staticmethod |
@@ -80,13 +83,13 @@ def test_node_quantization_by_next_nodes(self, fw_info_mock): |
80 | 83 | edge_list=[Edge(first_node, preserving_node, 0, 0), |
81 | 84 | Edge(preserving_node, no_quant_node, 0, 0)]) |
82 | 85 |
|
83 | | - first_node_config_kwargs = {"activation_n_bits": 8, |
| 86 | + first_node_config_kwargs = {"activation_n_bits": 16, |
84 | 87 | "supported_input_activation_n_bits": [8, 16], |
85 | 88 | "enable_activation_quantization": True, |
86 | 89 | "quantization_preserving": False} |
87 | 90 |
|
88 | 91 | preserving_node_config_kwargs = {"activation_n_bits": 8, |
89 | | - "supported_input_activation_n_bits": [8], |
| 92 | + "supported_input_activation_n_bits": [8, 16], |
90 | 93 | "enable_activation_quantization": False, |
91 | 94 | "quantization_preserving": True} |
92 | 95 |
|
@@ -115,8 +118,7 @@ def test_node_quantization_by_next_nodes(self, fw_info_mock): |
115 | 118 | set_quantization_configs_to_node(preserving_node, graph, QuantizationConfig(), fw_info_mock, fqc) |
116 | 119 | set_quantization_configs_to_node(no_quant_node, graph, QuantizationConfig(), fw_info_mock, fqc) |
117 | 120 |
|
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() |
120 | 123 | assert not no_quant_node.is_quantization_preserving() and not no_quant_node.is_activation_quantization_enabled() |
121 | 124 |
|
122 | | - print("a") |
|
0 commit comments