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
{{ message }}
Repository navigation
tf.experimental.numpy.cumsum / cumprod raise for bool input instead of promoting to int like NumPy #129239
NumPy promotes bool input to the default int for cumsum/cumprod (np.cumsum([True, False, True]) == [1, 1, 2]). In tnp, _maybe_promote_to_int (np_array_ops.py#L528) only handles integer dtypes, so bool reaches the Cumsum/Cumprod kernels and raises InvalidArgumentError. tnp.sum/tnp.prod already promote bool through _reduce.
[1 1 2] [1 1 0]
cumsum InvalidArgumentError Value forattr 'T' of bool is notin the list of allowed values: float, double, int32, uint8, int16, int8, complex64, in
cumprod InvalidArgumentError Value forattr 'T' of bool is notin the list of allowed values: float, double, int32, uint8, int16, int8, complex64, in
Hi @bodapatisaikrishna,
Thanks for reporting the issue and submitting a fix for TensorFlow. Once the PR is merged, the issue will be resolved. We truly appreciate your initiative and the effort in contributing the fix.
Activity
Kayyuri commentedon Oct 19, 2026
Hi @bodapatisaikrishna,
Thanks for reporting the issue and submitting a fix for TensorFlow. Once the PR is merged, the issue will be resolved. We truly appreciate your initiative and the effort in contributing the fix.
Fix several NumPy mismatches in tf.experimental.numpy
google-ml-butler commentedon Oct 23, 2026
Are you satisfied with the resolution of your issue?
Yes
No