Hadamard transform for MLX arrays
mlx_hadamard_transform.RdMultiplies 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)where- nis the size of the transformed axis; set- scaleto override the factor (for example,- scale = 1yields the unnormalised Hadamard transform).