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
3932 if isinstance (eager_output , tuple ):
4033 # TODO: Allow validating other items
@@ -65,3 +58,9 @@ def test_emformer_export_to_executorch(self):
6558 eager_model = eager_model .eval ()
6659
6760 self ._assert_eager_lowered_same_result (eager_model , example_inputs )
61+
62+ def test_vit_export_to_executorch (self ):
63+ eager_model , example_inputs = MODEL_NAME_TO_MODEL ["vit" ]()
64+ eager_model = eager_model .eval ()
65+
66+ self ._assert_eager_lowered_same_result (eager_model , example_inputs )
0 commit comments