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

Method test_dialect

backends/cortex_m/test/tester.py:100–126  ·  view source on GitHub ↗

Test the python dialect op implementation.

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

Source from the content-addressed store, hash-verified

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 """

Callers 15

test_dialect_softmaxFunction · 0.95
test_dialect_conv2dFunction · 0.95
test_dialect_transposeFunction · 0.95
test_dialect_maximumFunction · 0.95
test_dialect_max_pool2dFunction · 0.95
test_dialect_padFunction · 0.95
test_dialect_mulFunction · 0.95
test_dialect_lstmFunction · 0.95

Calls 7

CortexMQuantizeClass · 0.85
check_countMethod · 0.80
quantizeMethod · 0.45
exportMethod · 0.45
to_edgeMethod · 0.45
run_passesMethod · 0.45

Tested by

no test coverage detected