7
7
# pyre-strict
8
8
9
9
import logging
10
- import sys
11
10
import unittest
12
11
13
12
import torch
13
+ from executorch .backends .apple .coreml .recipes import CoreMLRecipeProvider # pyre-ignore
14
14
from executorch .backends .xnnpack .recipes .xnnpack_recipe_provider import (
15
15
XNNPACKRecipeProvider ,
16
16
)
17
17
from executorch .export import export , recipe_registry
18
18
from executorch .export .target_recipes import get_ios_recipe
19
19
from executorch .runtime import Runtime
20
20
21
- if sys .platform != "win32" :
22
- from executorch .backends .apple .coreml .recipes import ( # pyre-ignore
23
- CoreMLRecipeProvider ,
24
- )
25
-
26
21
27
22
class TestTargetRecipes (unittest .TestCase ):
28
23
"""Test target recipes."""
@@ -31,14 +26,12 @@ def setUp(self) -> None:
31
26
torch ._dynamo .reset ()
32
27
super ().setUp ()
33
28
recipe_registry .register_backend_recipe_provider (XNNPACKRecipeProvider ())
34
- if sys .platform != "win32" :
35
- # pyre-ignore
36
- recipe_registry .register_backend_recipe_provider (CoreMLRecipeProvider ())
29
+ # pyre-ignore
30
+ recipe_registry .register_backend_recipe_provider (CoreMLRecipeProvider ())
37
31
38
32
def tearDown (self ) -> None :
39
33
super ().tearDown ()
40
34
41
- @unittest .skipIf (sys .platform == "win32" , "Core ML is not available on Windows." )
42
35
def test_ios_fp32_recipe_with_xnnpack_fallback (self ) -> None :
43
36
# Linear ops skipped by coreml but handled by xnnpack
44
37
class Model (torch .nn .Module ):
@@ -114,7 +107,6 @@ def forward(self, x, y):
114
107
et_output = session .run_method ("forward" , example_inputs [0 ])
115
108
logging .info (f"et output { et_output } " )
116
109
117
- @unittest .skipIf (sys .platform == "win32" , "Core ML is not available on Windows." )
118
110
def test_ios_quant_recipes (self ) -> None :
119
111
class Model (torch .nn .Module ):
120
112
def __init__ (self ):
0 commit comments