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