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

"where" fails with IndexError #1065

Closed
suranap opened this issue Nov 1, 2023 · 1 comment
Closed

"where" fails with IndexError #1065

suranap opened this issue Nov 1, 2023 · 1 comment

Comments

@suranap
Copy link

suranap commented Nov 1, 2023

self.array[:] = np.where(rhs1.array, rhs2.array, rhs3.array)

Welcome to Legion Python interactive console
>>> import cunumeric
>>> import numpy
>>> cunumeric.where(2,1,1)
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/home/auser/mambaforge/envs/legate/lib/python3.1/site-packages/legate/core/runtime.py", line 2149, in wrapper
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/home/auser/mambaforge/envs/legate/lib/python3.1/site-packages/cunumeric/coverage.py", line 120, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/auser/mambaforge/envs/legate/lib/python3.1/site-packages/cunumeric/array.py", line 148, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/auser/mambaforge/envs/legate/lib/python3.1/site-packages/cunumeric/module.py", line 2995, in where
    return ndarray._perform_where(a, x, y)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/auser/mambaforge/envs/legate/lib/python3.1/site-packages/cunumeric/array.py", line 4386, in _perform_where
    out._thunk.where(mask._thunk, one._thunk, two._thunk)
  File "/home/auser/mambaforge/envs/legate/lib/python3.1/site-packages/cunumeric/eager.py", line 1618, in where
    self.array[:] = np.where(rhs1.array, rhs2.array, rhs3.array)
    ~~~~~~~~~~^^^
IndexError: too many indices for array: array is 0-dimensional, but 1 were indexed
>>> numpy.where(2,1,1)
array(1)
>>>
manopapad added a commit to manopapad/cunumeric that referenced this issue Nov 3, 2023
@manopapad
Copy link
Contributor

Thanks for reporting this! This should be fixed with #1067

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants