File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -18,9 +18,9 @@ def sandwich_dot(X, W):
18
18
# most.
19
19
# While a dedicated Cython routine could exploit the symmetry, it is very hard to
20
20
# beat BLAS GEMM, even thought the latter cannot exploit the symmetry, unless one
21
- # pays the price of a taking square roots and implements
21
+ # pays the price of taking square roots and implements
22
22
# sqrtWX = sqrt(W)[: None] * X
23
- # return np.dot( sqrtWX.T, sqrtWX)
23
+ # return sqrtWX.T @ sqrtWX
24
24
# which (might) detect the symmetry and use BLAS SYRK under the hood.
25
25
n_samples = X .shape [0 ]
26
26
if sparse .issparse (X ):
@@ -31,7 +31,7 @@ def sandwich_dot(X, W):
31
31
# np.einsum may use less memory but the following, using BLAS matrix
32
32
# multiplication (gemm), is by far faster.
33
33
WX = W [:, None ] * X
34
- return np . dot ( X .T , WX )
34
+ return X .T @ WX
35
35
36
36
37
37
class LinearModelLoss :
You can’t perform that action at this time.
0 commit comments