Skip to content

Conversation

@cetagostini
Copy link

Proposed changes

Enhanced indexing logic to handle numpy scalar types and boolean masks in mlx arrays. Updated C++ implementation to convert boolean masks to integer indices and support numpy scalar types in indexing and assignment. Added comprehensive tests for numpy scalar and boolean mask indexing behaviors.

Solve issue: #2710

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)

Enhanced indexing logic to handle numpy scalar types and boolean masks in mlx arrays. Updated C++ implementation to convert boolean masks to integer indices and support numpy scalar types in indexing and assignment. Added comprehensive tests for numpy scalar and boolean mask indexing behaviors.
@cetagostini
Copy link
Author

cetagostini commented Oct 29, 2025

Hey MLX team, thanks for the awesome library. Opening this to actually get better support of certain indexing things into pytensor, which allow now MLX backend :)

cc: @awni @angeloskath

@cetagostini
Copy link
Author

Hey guys, did you had a chance to take a look here? @awni @angeloskath

@awni
Copy link
Member

awni commented Nov 4, 2025

Thanks for the contribution!

The boolean indexing conflicts with #2663. Could you please remove it and we will land it in #2663 ?

After that we can review the numpy scalar indexing addtion.

@cetagostini cetagostini closed this Nov 5, 2025
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.

2 participants