77# pyre-strict
88
99import logging
10+ import sys
1011import unittest
1112
1213import torch
13- from executorch .backends .apple .coreml .recipes import CoreMLRecipeProvider # pyre-ignore
1414from executorch .backends .xnnpack .recipes .xnnpack_recipe_provider import (
1515 XNNPACKRecipeProvider ,
1616)
1717from executorch .export import export , recipe_registry
1818from executorch .export .target_recipes import get_ios_recipe
1919from executorch .runtime import Runtime
2020
21+ if sys .platform != "win32" :
22+ from executorch .backends .apple .coreml .recipes import ( # pyre-ignore
23+ CoreMLRecipeProvider ,
24+ )
25+
2126
2227class TestTargetRecipes (unittest .TestCase ):
2328 """Test target recipes."""
@@ -26,12 +31,14 @@ def setUp(self) -> None:
2631 torch ._dynamo .reset ()
2732 super ().setUp ()
2833 recipe_registry .register_backend_recipe_provider (XNNPACKRecipeProvider ())
29- # pyre-ignore
30- recipe_registry .register_backend_recipe_provider (CoreMLRecipeProvider ())
34+ if sys .platform != "win32" :
35+ # pyre-ignore
36+ recipe_registry .register_backend_recipe_provider (CoreMLRecipeProvider ())
3137
3238 def tearDown (self ) -> None :
3339 super ().tearDown ()
3440
41+ @unittest .skipIf (sys .platform == "win32" , "Core ML is not available on Windows." )
3542 def test_ios_fp32_recipe_with_xnnpack_fallback (self ) -> None :
3643 # Linear ops skipped by coreml but handled by xnnpack
3744 class Model (torch .nn .Module ):
@@ -107,6 +114,7 @@ def forward(self, x, y):
107114 et_output = session .run_method ("forward" , example_inputs [0 ])
108115 logging .info (f"et output { et_output } " )
109116
117+ @unittest .skipIf (sys .platform == "win32" , "Core ML is not available on Windows." )
110118 def test_ios_quant_recipes (self ) -> None :
111119 class Model (torch .nn .Module ):
112120 def __init__ (self ):
0 commit comments