8000 added stable_cumsum's axis testing · scikit-learn/scikit-learn@63ded1e · GitHub
[go: up one dir, main page]

Skip to content

Commit 63ded1e

Browse files
committed
added stable_cumsum's axis testing
1 parent b7e1293 commit 63ded1e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sklearn/utils/tests/test_extmath.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,3 +658,9 @@ def test_stable_cumsum():
658658
'cumsum was found to be unstable: its last element '
659659
'does not correspond to sum',
660660
stable_cumsum, r, rtol=0, atol=0)
661+
662+
# test axis parameter
663+
A = np.random.RandomState(36).randint(1000, size=(5, 5))
664+
assert_array_equal(stable_cumsum(A, axis=0), np.cumsum(A, axis=0))
665+
assert_array_equal(stable_cumsum(A, axis=1), np.cumsum(A, axis=1))
666+
assert_array_equal(stable_cumsum(A, axis=2), np.cumsum(A, axis=2))

0 commit comments

Comments
 (0)
0