Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upcast unsigned integer dtypes in cumsum and cumprod #9594

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add upcasting and overflow tests to bottom
  • Loading branch information
peterzsohar committed May 29, 2024
commit c30afc68d3a413cfa9882b65b5ba508132622776
8 changes: 6 additions & 2 deletions numba/tests/test_array_reductions.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,15 +585,19 @@ def test_array_prod_global(self):
def check_cumulative(self, pyfunc):
arr = np.arange(2, 10, dtype=np.int16)
expected, got = run_comparative(pyfunc, arr)
arr = np.array([255, 2], dtype=np.uint8)
expected, got = run_comparative(pyfunc, arr)
self.assertPreciseEqual(got, expected)
arr = np.linspace(2, 8, 6)
expected, got = run_comparative(pyfunc, arr)
self.assertPreciseEqual(got, expected)
arr = arr.reshape((3, 2))
expected, got = run_comparative(pyfunc, arr)
self.assertPreciseEqual(got, expected)
arr = np.array([127, 2], dtype=np.int8)
expected, got = run_comparative(pyfunc, arr)
self.assertPreciseEqual(got, expected)
arr = np.array([255, 2], dtype=np.uint8)
expected, got = run_comparative(pyfunc, arr)
self.assertPreciseEqual(got, expected)

def test_array_cumsum(self):
self.check_cumulative(array_cumsum)
Expand Down