|
20 | 20 |
|
21 | 21 |
|
22 | 22 | class SimpleQuantizeModel(torch.nn.Module): |
23 | | - def forward(self, x, y): |
24 | | - return x + torch.max((x + x), (y + y)) |
| 23 | + def forward(self, x): |
| 24 | + return x + x |
25 | 25 |
|
26 | 26 | def get_inputs(self): |
27 | | - return (torch.rand(1, 1280, 7, 7), torch.rand(1, 1280, 7, 7)) |
| 27 | + return (torch.rand(1, 1280, 7, 7),) |
28 | 28 |
|
29 | 29 |
|
30 | 30 | class FoldAndAnnotateQParamsPassTestClass(FoldAndAnnotateQParamsPass): |
31 | 31 | def __init__(self): |
32 | 32 | super(FoldAndAnnotateQParamsPassTestClass, self).__init__( |
33 | | - [ |
34 | | - exir_ops.edge.aten.add.Tensor, |
35 | | - exir_ops.edge.aten.maximum.default, |
36 | | - ] |
| 33 | + [exir_ops.edge.aten.add.Tensor] |
37 | 34 | ) |
38 | 35 |
|
39 | 36 |
|
@@ -61,15 +58,15 @@ def test_fold_qdq_pass(self): |
61 | 58 | .to_edge() |
62 | 59 | .check_count( |
63 | 60 | { |
64 | | - "executorch_exir_dialects_edge__ops_quantized_decomposed_dequantize_per_tensor_default": 7, |
65 | | - "executorch_exir_dialects_edge__ops_quantized_decomposed_quantize_per_tensor_default": 6, |
| 61 | + "executorch_exir_dialects_edge__ops_quantized_decomposed_dequantize_per_tensor_default": 2, |
| 62 | + "executorch_exir_dialects_edge__ops_quantized_decomposed_quantize_per_tensor_default": 2, |
66 | 63 | } |
67 | 64 | ) |
68 | 65 | .run_passes(test_pass_stage) |
69 | 66 | .check_count( |
70 | 67 | { |
71 | 68 | "executorch_exir_dialects_edge__ops_quantized_decomposed_dequantize_per_tensor_default": 1, |
72 | | - "executorch_exir_dialects_edge__ops_quantized_decomposed_quantize_per_tensor_default": 2, |
| 69 | + "executorch_exir_dialects_edge__ops_quantized_decomposed_quantize_per_tensor_default": 1, |
73 | 70 | } |
74 | 71 | ) |
75 | 72 | ) |
0 commit comments