BUG: initial
parameter in reduction operations is incorrectly type-converted
#21668
Labels
initial
parameter in reduction operations is incorrectly type-converted
#21668
Describe the issue:
When the
initial
parameter of a reduction operation has a type that is different from the contents of the array, it is converted to match in C, and thereby circumvents many of the checks that would normally go with such a conversion in Python. This sometimes leads to behavior that would make sense in C, but seems incorrect in Python. It seems to me thatinitial
should be converted to the same type as the array in the Python function before it is passed to the C layer.Reproduce the code example:
NumPy/Python version information:
Numpy 1.20.2
Python 3.9.2 (tags/v3.9.2:1a79785, Feb 19 2021, 13:44:55) [MSC v.1928 64 bit (AMD64)]
The text was updated successfully, but these errors were encountered: