1111from executorch .examples .export .utils import _CAPTURE_CONFIG , _EDGE_COMPILE_CONFIG
1212from executorch .examples .models import MODEL_NAME_TO_MODEL
1313
14- # pyre-ignore[21]: Could not find module `executorch.extension.pybindings.portable`.
15- from executorch .extension .pybindings .portable import ( # @manual
16- _load_for_executorch_from_buffer ,
17- )
18-
1914
2015class ExportTest (unittest .TestCase ):
2116 def _assert_eager_lowered_same_result (
@@ -28,13 +23,11 @@ def _assert_eager_lowered_same_result(
2823 )
2924
3025 executorch_model = edge_model .to_executorch ()
31- # pyre-ignore
32- pte_model = _load_for_executorch_from_buffer (executorch_model .buffer )
3326
3427 with torch .no_grad ():
3528 eager_output = eager_model (* example_inputs )
3629 with torch .no_grad ():
37- executorch_output = pte_model . forward ( example_inputs )
30+ executorch_output = executorch_model . exported_program ( * example_inputs )
3831 self .assertTrue (
3932 torch .allclose (eager_output , executorch_output [0 ], rtol = 1e-5 , atol = 1e-5 )
4033 )
@@ -50,3 +43,9 @@ def test_mv2_export_to_executorch(self):
5043 eager_model = eager_model .eval ()
5144
5245 self ._assert_eager_lowered_same_result (eager_model , example_inputs )
46+
47+ def test_vit_export_to_executorch (self ):
48+ eager_model , example_inputs = MODEL_NAME_TO_MODEL ["vit" ]()
49+ eager_model = eager_model .eval ()
50+
51+ self ._assert_eager_lowered_same_result (eager_model , example_inputs )
0 commit comments