diff options
author | Thomas Green <tomgreen66@hotmail.com> | 2021-12-08 11:57:10 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-08 11:57:10 +0000 |
commit | dc766fc1abb546ab883f76ef4e405e99e9287ab6 (patch) | |
tree | 9e7c7748ba8bfbb2ba5224633b0725909712d2fa /numpy/array_api/_statistical_functions.py | |
parent | 1cfdac82ac793061d8ca4b07c046fc6b21ee7e54 (diff) | |
parent | ab7a1927353ab9dd52e3f2f7a1a889ae790667b9 (diff) | |
download | numpy-dc766fc1abb546ab883f76ef4e405e99e9287ab6.tar.gz |
Merge branch 'numpy:main' into armcompiler
Diffstat (limited to 'numpy/array_api/_statistical_functions.py')
-rw-r--r-- | numpy/array_api/_statistical_functions.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/array_api/_statistical_functions.py b/numpy/array_api/_statistical_functions.py index 7bee3f4db..5bc831ac2 100644 --- a/numpy/array_api/_statistical_functions.py +++ b/numpy/array_api/_statistical_functions.py @@ -65,8 +65,8 @@ def prod( # Note: sum() and prod() always upcast float32 to float64 for dtype=None # We need to do so here before computing the product to avoid overflow if dtype is None and x.dtype == float32: - x = asarray(x, dtype=float64) - return Array._new(np.prod(x._array, axis=axis, keepdims=keepdims)) + dtype = float64 + return Array._new(np.prod(x._array, dtype=dtype, axis=axis, keepdims=keepdims)) def std( |