8000 Fix tests on numpy master · scikit-learn/scikit-learn@8fb95cb · GitHub
[go: up one dir, main page]

Skip to content

Commit 8fb95cb

Browse files
committed
Fix tests on numpy master
8000 numpy.apply_along_axis has changed behaviour when the function passed in returns a 2d array
1 parent 05b5b37 commit 8fb95cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sklearn/gaussian_process/kernels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1852,7 +1852,7 @@ def diag(self, X):
18521852
Diagonal of kernel k(X, X)
18531853
"""
18541854
# We have to fall back to slow way of computing diagonal
1855-
return np.apply_along_axis(self, 1, X)[:, 0]
1855+
return np.apply_along_axis(lambda arr: self(arr).ravel(), 1, X)[:, 0]
18561856

18571857
def is_stationary(self):
18581858
"""Returns whether the kernel is stationary. """

0 commit comments

Comments
 (0)
0