-
Notifications
You must be signed in to change notification settings - Fork 80
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/module: implement numpy.meshgrid
#587
base: branch-24.03
Are you sure you want to change the base?
Conversation
This commit implements the function `numpy.meshgrid`.
|
||
if not sparse: | ||
# Return the full N-D matrix (not only the 1-D vector). | ||
output = np.broadcast_arrays(*output, subok=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@magnatelee is there a reason why we haven't implemented broadcast
, broadcast_to
and broadcast_arrays
? If not, I can add them relatively easily as part of this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is ongoing work #458
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sweet, i'll just wait for that.
|
||
if indexing == "xy" and ndim > 1: | ||
# Switch first and second axis. | ||
output[0].shape = (1, -1) + s0[2:] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This implementation from numpy muddles around with the shape
parameter of the array. Is there something equivalent that I can do that works on both eager and deferred arrays? I'm not sure the right API call to make.
@rohany can you sign off this pull request? you can force push changes if you need to. |
Yes, I will when the PR is ready (it's quite far from that right now). |
This commit implements the function
numpy.meshgrid
.