Test the optimized op implementation in simulation
(self, qtol=0, atol=1e-03, calibration_samples=None)
| 126 | ) |
| 127 | |
| 128 | def test_implementation(self, qtol=0, atol=1e-03, calibration_samples=None): |
| 129 | """ |
| 130 | Test the optimized op implementation in simulation |
| 131 | """ |
| 132 | |
| 133 | if calibration_samples is not None: |
| 134 | quantization_stage = CortexMQuantize( |
| 135 | calibration_samples=calibration_samples |
| 136 | ) |
| 137 | else: |
| 138 | quantization_stage = None |
| 139 | |
| 140 | self.quantize(quantization_stage) |
| 141 | self.export() |
| 142 | self.to_edge() |
| 143 | self.run_passes() |
| 144 | self.to_executorch() |
| 145 | self.serialize() |
| 146 | self.run_method_and_compare_outputs( |
| 147 | inputs=self.example_inputs, qtol=qtol, atol=atol |
| 148 | ) |
| 149 | |
| 150 | |
| 151 | @dataclass |
no test coverage detected