|
11 | 11 |
|
12 | 12 | import torch |
13 | 13 | from executorch.exir.program import EdgeProgramManager, ExecutorchProgramManager |
14 | | -from executorch.export import ExportRecipe, QuantizationRecipe |
15 | | -from executorch.export.export import ( |
| 14 | +from executorch.export import ( |
16 | 15 | EdgeTransformAndLowerStage, |
17 | 16 | ExecutorchStage, |
| 17 | + ExportRecipe, |
18 | 18 | ExportSession, |
19 | 19 | ExportStage, |
| 20 | + QuantizationRecipe, |
20 | 21 | QuantizeStage, |
21 | 22 | SourceTransformStage, |
22 | 23 | ) |
@@ -263,7 +264,7 @@ def test_export_session_full_quantization_pipeline(self) -> None: |
263 | 264 | actual_stages = [stage.name for stage in session._pipeline] |
264 | 265 | self.assertEqual(actual_stages, expected_stages) |
265 | 266 |
|
266 | | - @patch("executorch.export.export.ExportSession._run_pipeline") |
| 267 | + @patch("executorch.export.ExportSession._run_pipeline") |
267 | 268 | def test_export_session_export_calls_pipeline( |
268 | 269 | self, mock_run_pipeline: Mock |
269 | 270 | ) -> None: |
@@ -369,9 +370,9 @@ def setUp(self) -> None: |
369 | 370 | self.model = SimpleTestModel() |
370 | 371 | self.example_inputs = [(torch.randn(2, 10),)] |
371 | 372 |
|
372 | | - @patch("executorch.export.export.ExecutorchStage") |
373 | | - @patch("executorch.export.export.EdgeTransformAndLowerStage") |
374 | | - @patch("executorch.export.export.ExportStage") |
| 373 | + @patch("executorch.export.ExecutorchStage") |
| 374 | + @patch("executorch.export.EdgeTransformAndLowerStage") |
| 375 | + @patch("executorch.export.ExportStage") |
375 | 376 | def test_pipeline_execution_order_fp32( |
376 | 377 | self, |
377 | 378 | mock_export_stage_class: Mock, |
@@ -412,10 +413,10 @@ def test_pipeline_execution_order_fp32( |
412 | 413 | mock_edge_stage.run.assert_called_once() |
413 | 414 | mock_executorch_stage.run.assert_called_once() |
414 | 415 |
|
415 | | - @patch("executorch.export.export.ExecutorchStage") |
416 | | - @patch("executorch.export.export.EdgeTransformAndLowerStage") |
417 | | - @patch("executorch.export.export.ExportStage") |
418 | | - @patch("executorch.export.export.QuantizeStage") |
| 416 | + @patch("executorch.export.ExecutorchStage") |
| 417 | + @patch("executorch.export.EdgeTransformAndLowerStage") |
| 418 | + @patch("executorch.export.ExportStage") |
| 419 | + @patch("executorch.export.QuantizeStage") |
419 | 420 | def test_pipeline_execution_order_quantized( |
420 | 421 | self, |
421 | 422 | mock_quantize_stage_class: Mock, |
@@ -474,7 +475,7 @@ def setUp(self) -> None: |
474 | 475 | self.model = SimpleTestModel() |
475 | 476 | self.example_inputs = [(torch.randn(2, 10),)] |
476 | 477 |
|
477 | | - @patch("executorch.export.export.ExportSession") |
| 478 | + @patch("executorch.export.ExportSession") |
478 | 479 | def test_export_function_creates_session_and_exports( |
479 | 480 | self, mock_session_class: Mock |
480 | 481 | ) -> None: |
|
0 commit comments