diff options
| author | Sebastian Berg <sebastian@sipsolutions.net> | 2022-01-28 15:58:09 -0600 |
|---|---|---|
| committer | Sebastian Berg <sebastianb@nvidia.com> | 2023-01-20 15:28:47 +0100 |
| commit | ffe18c971d4d122dc36cafcc6651b44118d08d39 (patch) | |
| tree | 3f8012aedc64f00c39421ad783d45efc8a75ffd3 /numpy/array_api/_searching_functions.py | |
| parent | 707c3bffc32d170d9953996ee40c54988a8aac98 (diff) | |
| download | numpy-ffe18c971d4d122dc36cafcc6651b44118d08d39.tar.gz | |
ENH: Move identity to the ArrayMethod to allow customization
This also fixes/changes that the identity value is defined by the
reduce dtype and not by the result dtype. That does not make a
different in any sane use-case, but there is a theoretical change:
arr = np.array([])
out = np.array(None) # object array
np.add.reduce(arr, out=out, dtype=np.float64)
Where the output result was previously an integer 0, due to the
output being of `object` dtype, but now it is the correct float
due to the _operation_ being done in `float64`, so that the output
should be `np.zeros((), dtype=np.float64).astype(object)`.
Diffstat (limited to 'numpy/array_api/_searching_functions.py')
0 files changed, 0 insertions, 0 deletions
