Skip to content

Commit b851eec

Browse files
authored
Merge pull request #280 from IntelPython/dpnp_cov_dtype
Added dtype parameter in np.cov() function call.
2 parents b28447d + 875297b commit b851eec

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)