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

cunumeric.ndim #495

Merged
merged 4 commits into from
Aug 2, 2022
Merged

cunumeric.ndim #495

merged 4 commits into from
Aug 2, 2022

Conversation

magnatelee
Copy link
Contributor

Fixes #494

@rohany
Copy link
Member

rohany commented Aug 2, 2022

Does this work:

>>> import numpy
>>> numpy.ndim(1)
0

@magnatelee
Copy link
Contributor Author

magnatelee commented Aug 2, 2022

Does this work:

I think so

a_np = np.array(a)

assert np.ndim(a_np) == num.ndim(a)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also check a few non-ndarray values? e.g.

42
[0,1,2]
[[0,1,2],[3,4,5]]

Copy link
Contributor

@manopapad manopapad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Also updated the docs for ndim, and had to add some unrelated missing functions to fix the doc build.

One remaining comment above, to add a couple more cases to the tests.

@magnatelee magnatelee merged commit 2b9ea22 into nv-legate:branch-22.07 Aug 2, 2022
@magnatelee magnatelee deleted the ndim branch August 2, 2022 22:55
sbak5 pushed a commit to sbak5/cunumeric that referenced this pull request Aug 17, 2022
* Add cunumeric.ndim

* Add Avail. info to ndim, add to docs and API comparison table

* Add some missing function references to docs

* Test cases passing Python values to cunumeric.ndim

Co-authored-by: Manolis Papadakis <manopapad@gmail.com>
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

Successfully merging this pull request may close these issues.

implement numpy.ndim
3 participants