8000 FIX Hotfix Skip non deterministic tests on PowerPC (#13323) · xhluca/scikit-learn@b76763e · GitHub
[go: up one dir, main page]

Skip to content

Commit b76763e

Browse files
rthXing
authored and
Xing
committed
FIX Hotfix Skip non deterministic tests on PowerPC (scikit-learn#13323)
1 parent d536fcb commit b76763e

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

sklearn/base.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import copy
77
import warnings
88
from collections import defaultdict
9-
import struct
9+
import platform
1010
import inspect
1111

1212
import numpy as np
@@ -555,10 +555,11 @@ def _more_tags(self):
555555
return {'multioutput': True}
556556

557557

558-
class _UnstableOn32BitMixin(object):
559-
"""Mark estimators that are non-determinstic on 32bit."""
558+
class _UnstableArchMixin(object):
559+
"""Mark estimators that are non-determinstic on 32bit or PowerPC"""
560560
def _more_tags(self):
561-
return {'non_deterministic': _IS_32BIT}
561+
return {'non_deterministic': (
562+
_IS_32BIT or platform.machine().startswith(('ppc', 'powerpc')))}
562563

563564

564565
def is_classifier(estimator):

sklearn/cross_decomposition/cca_.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
from .pls_ import _PLS
2-
from ..base import _UnstableOn32BitMixin
2+
from ..base import _UnstableArchMixin
33

44
__all__ = ['CCA']
55

66

7-
class CCA(_PLS, _UnstableOn32BitMixin):
7+
class CCA(_PLS, _UnstableArchMixin):
88
"""CCA Canonical Correlation Analysis.
99
1010
CCA inherits from PLS with mode="B" and deflation_mode="canonical".

sklearn/manifold/locally_linear.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from scipy.sparse import eye, csr_matrix
1010
from scipy.sparse.linalg import eigsh
1111

12-
from ..base import BaseEstimator, TransformerMixin, _UnstableOn32BitMixin
12+
from ..base import BaseEstimator, TransformerMixin, _UnstableArchMixin
1313
from ..utils import check_random_state, check_array
1414
from ..utils.extmath import stable_cumsum
1515
from ..utils.validation import check_is_fitted
@@ -519,7 +519,7 @@ def locally_linear_embedding(
519519

520520

521521
class LocallyLinearEmbedding(BaseEstimator, TransformerMixin,
522-
_UnstableOn32BitMixin):
522+
_UnstableArchMixin):
523523
"""Locally Linear Embedding
524524
525525
Read more in the :ref:`User Guide <locally_linear_embedding>`.

0 commit comments

Comments
 (0)
0