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

missing functions from ops.h #23

Open
davidkoski opened this issue Apr 29, 2024 · 1 comment
Open

missing functions from ops.h #23

davidkoski opened this issue Apr 29, 2024 · 1 comment

Comments

@davidkoski
Copy link
Collaborator

I noticed that these are missing from ops.h:

/**
 * Extract the number of elements along some axes as a scalar array. Used to
 * allow shape dependent shapeless compilation (pun intended).
 */
array number_of_elements(
    const array& a,
    std::vector<int> axes,
    bool inverted,
    Dtype dtype = int32,
    StreamOrDevice s = {});

/** Bitwise and. */
array bitwise_and(const array& a, const array& b, StreamOrDevice s = {});
array operator&(const array& a, const array& b);

/** Bitwise inclusive or. */
array bitwise_or(const array& a, const array& b, StreamOrDevice s = {});
array operator|(const array& a, const array& b);

/** Bitwise exclusive or. */
array bitwise_xor(const array& a, const array& b, StreamOrDevice s = {});
array operator^(const array& a, const array& b);

/** Shift bits to the left. */
array left_shift(const array& a, const array& b, StreamOrDevice s = {});
array operator<<(const array& a, const array& b);

/** Shift bits to the right. */
array right_shift(const array& a, const array& b, StreamOrDevice s = {});
array operator>>(const array& a, const array& b);

I am not sure about number_of_elements() but the bitwise and arithmetic shift functions should be added.

@awni
Copy link
Member

awni commented Apr 30, 2024

Yea it would be good to add the bitwise ops. number_of_elements probably shouldn't be added as it is mostly used internally for now.

davidkoski added a commit to davidkoski/mlx-swift that referenced this issue May 2, 2024
- some changes from mlx were skipped as we were just updating what we built against
- this pulls in remaining changes from ml-explore/mlx@v0.8.1...v0.12.1
- with the exception of the bitwise operators: ml-explore/mlx-c#23
davidkoski added a commit to ml-explore/mlx-swift that referenced this issue May 3, 2024
- some changes from mlx were skipped as we were just updating what we built against
- this pulls in remaining changes from ml-explore/mlx@v0.8.1...v0.12.1
- with the exception of the bitwise operators: ml-explore/mlx-c#23
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