input x shape: [n_embd, n_tokens] output shape: [n_embd, n_tokens]
| 310 | // input x shape: [n_embd, n_tokens] |
| 311 | // output shape: [n_embd, n_tokens] |
| 312 | ggml_tensor * llm_build_gemma3n_iswa::gaussian_topk(ggml_tensor * x) { |
| 313 | ggml_tensor * mean = ggml_mean(ctx0, x); |
| 314 | ggml_tensor * std = ggml_sqrt(ctx0, ggml_scale(ctx0, ggml_sum_rows(ctx0, ggml_sqr(ctx0, ggml_sub(ctx0, x, mean))), |
| 315 | 1.0f / (float) (x->ne[0] - 1))); |
| 316 | ggml_tensor * cutoff_x = ggml_add(ctx0, mean, ggml_scale(ctx0, std, f_sparsity_std_mul)); |
| 317 | return ggml_relu(ctx0, ggml_sub(ctx0, x, cutoff_x)); |
| 318 | } |
| 319 | |
| 320 | // |
| 321 | // altup functions |
nothing calls this directly
no test coverage detected