Skip to content

Fix Issue 4034 return as a tuple - #4229

Open
JasonHonKL wants to merge 2 commits into
ml-explore:mainfrom
JasonHonKL:issue/4034
Open

Fix Issue 4034 return as a tuple#4229
JasonHonKL wants to merge 2 commits into
ml-explore:mainfrom
JasonHonKL:issue/4034

Conversation

@JasonHonKL

Copy link
Copy Markdown
Contributor

Proposed changes

Fix #4034

Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING document
  • I have run pre-commit run --all-files to format my code / installed pre-commit prior to committing changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the necessary documentation (if needed)

Comment thread python/src/ops.cpp
std::vector<mx::array> arrays =
nb::cast<std::vector<mx::array>>(arrays_);
return mx::meshgrid(arrays, sparse, indexing, s);
return nb::tuple(nb::cast(mx::meshgrid(arrays, sparse, indexing, s)));

@zcbenz zcbenz Aug 13, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

would nb::cast<nb::tuple>() work?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't think so.

error: no matching function for call to 'cast'
note: candidate not viable: no known conversion from 'std::vector<array>' to 'nb::tuple'

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.

Returning a tuple instead of list for meshgrid to make it compliant with Array API

2 participants