Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7a2f907

Browse filesBrowse files
committed
Workaround MPS bug in torch.nextafter
1 parent 020cbe8 commit 7a2f907
Copy full SHA for 7a2f907

File tree

Expand file treeCollapse file tree

1 file changed

+8
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-0
lines changed

‎sklearn/utils/tests/test_stats.py

Copy file name to clipboardExpand all lines: sklearn/utils/tests/test_stats.py
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,14 @@ def test_weighted_percentile_array_api_consistency(
186186

187187
xp = _array_api_for_tests(array_namespace, device)
188188

189+
# Skip test for percentile=0 edge case (#20528) on namespace/device where
190+
# xp.nextafter is broken (e.g. torch with MPS device at the time of
191+
# writing).
192+
zero = xp.zeros(1, device=device)
193+
one = xp.ones(1, device=device)
194+
if percentile == 0 and xp.all(xp.nextafter(zero, one) == zero):
195+
pytest.xfail(f"xp.nextafter is broken on {device}")
196+
189197
rng = np.random.RandomState(global_random_seed)
190198
X_np = data(rng) if callable(data) else data
191199
weights_np = weights(rng) if callable(weights) else weights

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.