Skip to content

Commit 875297b

Browse files
committed
Added dtype parameter in np.cov() function call.
1 parent b28447d commit 875297b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

dpbench/benchmarks/pca/pca_dpnp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def pca(data, dims_rescaled_data=2):
1010
data -= data.mean(axis=0)
1111

1212
# calculate the covariance matrix
13-
v = np.cov(data, rowvar=False)
13+
v = np.cov(data, rowvar=False, dtype=data.dtype)
1414

1515
# calculate eigenvectors & eigenvalues of the covariance matrix
1616
evalues, evectors = np.linalg.eigh(v)

dpbench/benchmarks/pca/pca_numpy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def pca(data, dims_rescaled_data=2):
1010
data -= data.mean(axis=0)
1111

1212
# calculate the covariance matrix
13-
v = np.cov(data, rowvar=False)
13+
v = np.cov(data, rowvar=False, dtype=data.dtype)
1414

1515
# calculate eigenvectors & eigenvalues of the covariance matrix
1616
evalues, evectors = np.linalg.eigh(v)

0 commit comments

Comments
 (0)