Skip to content

Commit

Permalink
FIX: More robust test_extmath.py, compatible with older numpy
Browse files Browse the repository at this point in the history
  • Loading branch information
sdenton4 committed Apr 17, 2014
1 parent 9f07963 commit b70a481
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sklearn/utils/tests/test_extmath.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,15 +347,15 @@ def test_fast_dot():
# col < row
C = np.dot(A.T, A)
C_ = fast_dot(A.T, A)
assert_almost_equal(C, C_)
assert_almost_equal(C, C_, decimal=5)

C = np.dot(A.T, B)
C_ = fast_dot(A.T, B)
assert_almost_equal(C, C_)
assert_almost_equal(C, C_, decimal=5)

C = np.dot(A, B.T)
C_ = fast_dot(A, B.T)
assert_almost_equal(C, C_)
assert_almost_equal(C, C_, decimal=5)

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

C = np.dot(A, B)
C_ = fast_dot(A, B)
assert_almost_equal(C, C_)
assert_almost_equal(C, C_, decimal=5)

C = np.dot(A.T, B)
C_ = fast_dot(A.T, B)
assert_almost_equal(C, C_)
assert_almost_equal(C, C_, decimal=5)

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

0 comments on commit b70a481

Please sign in to comment.