Test the python dialect op implementation.
(
self,
ops_before_transforms,
ops_after_transforms,
qtol=0,
atol=1e-03,
calibration_samples=None,
)
| 98 | super().__init__(module, resolved_example_inputs, stage_classes) |
| 99 | |
| 100 | def test_dialect( |
| 101 | self, |
| 102 | ops_before_transforms, |
| 103 | ops_after_transforms, |
| 104 | qtol=0, |
| 105 | atol=1e-03, |
| 106 | calibration_samples=None, |
| 107 | ): |
| 108 | """ |
| 109 | Test the python dialect op implementation. |
| 110 | """ |
| 111 | if calibration_samples is not None: |
| 112 | quantization_stage = CortexMQuantize( |
| 113 | calibration_samples=calibration_samples |
| 114 | ) |
| 115 | else: |
| 116 | quantization_stage = None |
| 117 | |
| 118 | self.quantize(quantization_stage) |
| 119 | self.export() |
| 120 | self.to_edge() |
| 121 | self.check_count(ops_before_transforms) |
| 122 | self.run_passes() |
| 123 | self.check_count(ops_after_transforms) |
| 124 | self.run_method_and_compare_outputs( |
| 125 | inputs=self.example_inputs, qtol=qtol, atol=atol |
| 126 | ) |
| 127 | |
| 128 | def test_implementation(self, qtol=0, atol=1e-03, calibration_samples=None): |
| 129 | """ |
no test coverage detected