Skip to content

Commit 3c639ed

Browse files
committed
Return int64 for reductions of bools
1 parent ff53849 commit 3c639ed

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/blosc2/lazyexpr.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,6 +1819,8 @@ def infer_reduction_dtype(dtype, operation):
18191819
dtype, np.float32 if dtype in (np.float32, np.complex64) else blosc2.DEFAULT_FLOAT
18201820
)
18211821
if operation in {ReduceOp.SUM, ReduceOp.PROD}:
1822+
if np.issubdtype(dtype, np.bool_):
1823+
return np.int64
18221824
if np.issubdtype(dtype, np.unsignedinteger):
18231825
return np.result_type(dtype, np.uint64)
18241826
return np.result_type(dtype, np.int64 if np.issubdtype(dtype, np.integer) else my_float)

0 commit comments

Comments
 (0)