mlx-c
mlx-c copied to clipboard
missing functions from ops.h
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.
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 it looks to me these functions are now supported?