You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an .sum() operation is performed (which is a popular and important operation) on an int16 array it appears that numpy
upcasts int16 to int32 based on setbufsize
then sets the output value to 0
then the reduce routine adds up all the int32 and produced a result
another upcast from int16 to int32 occurs based on setbufsize
the previous output value is expected as the first input to add up all the numbers
I presume this is done due to either handle overflow, or round off error in sum (when it is a float32).
I recommend that this change because a sum routine can internally upcast and return the result of the upcast.
For instance int16 can be upcast to int64 (not sure why it is int32 on windows) at no cost since the int64 is held in registers.
Further the signature of the reduce for sum is coupled to the signature for add even though they should be different.
For example the reduce signature of add on int16 is really one input: dtype: int16 and outputs dtype:int64.
The text was updated successfully, but these errors were encountered:
When an .sum() operation is performed (which is a popular and important operation) on an int16 array it appears that numpy
I presume this is done due to either handle overflow, or round off error in sum (when it is a float32).
I recommend that this change because a sum routine can internally upcast and return the result of the upcast.
For instance int16 can be upcast to int64 (not sure why it is int32 on windows) at no cost since the int64 is held in registers.
Further the signature of the reduce for sum is coupled to the signature for add even though they should be different.
For example the reduce signature of add on int16 is really one input: dtype: int16 and outputs dtype:int64.
The text was updated successfully, but these errors were encountered: