Skip to content

Commit b70a481

Browse files
committed
FIX: More robust test_extmath.py, compatible with older numpy
1 parent 9f07963 commit b70a481

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sklearn/utils/tests/test_extmath.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -347,15 +347,15 @@ def test_fast_dot():
347347
# col < row
348348
C = np.dot(A.T, A)
349349
C_ = fast_dot(A.T, A)
350-
assert_almost_equal(C, C_)
350+
assert_almost_equal(C, C_, decimal=5)
351351

352352
C = np.dot(A.T, B)
353353
C_ = fast_dot(A.T, B)
354-
assert_almost_equal(C, C_)
354+
assert_almost_equal(C, C_, decimal=5)
355355

356356
C = np.dot(A, B.T)
357357
C_ = fast_dot(A, B.T)
358-
assert_almost_equal(C, C_)
358+
assert_almost_equal(C, C_, decimal=5)
359359

360360
# Test square matrix * rectangular use case.
361361
A = rng.random_sample([2, 2])
@@ -365,11 +365,11 @@ def test_fast_dot():
365365

366366
C = np.dot(A, B)
367367
C_ = fast_dot(A, B)
368-
assert_almost_equal(C, C_)
368+
assert_almost_equal(C, C_, decimal=5)
369369

370370
C = np.dot(A.T, B)
371371
C_ = fast_dot(A.T, B)
372-
assert_almost_equal(C, C_)
372+
assert_almost_equal(C, C_, decimal=5)
373373

374374
if has_blas:
375375
for x in [np.array([[d] * 10] * 2) for d in [np.inf, np.nan]]:

0 commit comments

Comments
 (0)