Uh oh!
There was an error while loading. Please reload this page.
forked from pytorch/executorch
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
Latest commit
38 lines (31 loc) · 1.5 KB
/
Copy pathconftest.py
File metadata and controls
38 lines (31 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
importhashlib
importplatform
importsys
importtorch
collect_ignore_glob: list[str] = []
# Skip Apple tests on Windows. Note that some Core ML tests can run on Linux, as the AOT flow
# is available. Tests will manage this internally. However, the coremltools import is not available
# on Windows and causes collection to fail. The easiest way to manage this seems to be to just
# skip collection for this subdirectory on unsupported platforms.
ifsys.platform=="win32":
collect_ignore_glob+= [
"backends/apple/**",
]
# Every test file under backends/apple/coreml that defines tests imports coremltools at module
# scope, so collection fails wherever the wheel does not declare it. Windows is already covered
# above; what is left is any Linux that is not x86_64, since coremltools publishes no build for
# those, and Python 3.14, for which it publishes no build on any platform. Keep this condition in
# sync with the coremltools marker in setup.py; .ci/scripts/tests/test_coreml_markers.py checks
# that the two agree.
_coremltools_is_declared= (
sys.platform=="darwin"
or (sys.platform.startswith("linux") andplatform.machine() =="x86_64")
) andsys.version_info< (3, 14)
ifnot_coremltools_is_declared:
collect_ignore_glob+= [
"backends/apple/coreml/**",
]
defpytest_runtest_setup(item):
# Set a stable seed for each test based on a hash of the test name.
seed=int(hashlib.sha256(item.nodeid.encode()).hexdigest(), 16) % (2**32)
torch.manual_seed(seed)