mirror of
https://github.com/ml-explore/mlx.git
synced 2025-12-16 01:49:05 +08:00
Fast Hadamard Transform (#1249)
* Working hadamard for powers of 2 * working for m*2^k * add scale and check contiguity * add size check * clean up * fix test * add grads + vmap * gpu only * skip on linux * test typo * add cpu impl * remove gpu only tests * fix linux build + add is_equivalent
This commit is contained in:
@@ -131,6 +131,12 @@ array flatten(
|
||||
/** Flatten the array to 1D. */
|
||||
array flatten(const array& a, StreamOrDevice s = {});
|
||||
|
||||
/** Multiply the array by the Hadamard matrix of corresponding size. */
|
||||
array hadamard_transform(
|
||||
const array& a,
|
||||
float scale = 1.0f,
|
||||
StreamOrDevice s = {});
|
||||
|
||||
/** Remove singleton dimensions at the given axes. */
|
||||
array squeeze(
|
||||
const array& a,
|
||||
|
||||
Reference in New Issue
Block a user