MCPcopy Create free account
hub / github.com/pytorch/executorch / test_implementation

Method test_implementation

backends/cortex_m/test/tester.py:128–148  ·  view source on GitHub ↗

Test the optimized op implementation in simulation

(self, qtol=0, atol=1e-03, calibration_samples=None)

Source from the content-addressed store, hash-verified

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

Calls 8

CortexMQuantizeClass · 0.85
quantizeMethod · 0.45
exportMethod · 0.45
to_edgeMethod · 0.45
run_passesMethod · 0.45
to_executorchMethod · 0.45
serializeMethod · 0.45

Tested by

no test coverage detected