Skip to content
fn

normalized_input_grad

::mlx::core::array normalized_input_grad(const ::mlx::core::array & g, const ::mlx::core::array & xnorm, const ::mlx::core::array & mean_g, const ::mlx::core::array & mean_g_xn, const ::mlx::core::array & scale)

scale * (g - mean_g - xnorm * mean_g_xn) in the accumulation dtype, rounded to g's dtype once, as one kernel.