Multiplies the last dimension of x by the Sylvester-Hadamard matrix of the
corresponding size. The transform expects the length of the last axis to be a
power of two.
Arguments
- x
An mlx array, or an R array/matrix/vector that will be converted via
as_mlx().- scale
Optional numeric scalar applied to the result. MLX defaults to
1 / sqrt(n)wherenis the size of the transformed axis; setscaleto override the factor (for example,scale = 1yields the unnormalised Hadamard transform).