/** * Normalization operations */ import type { WebInferContext } from '../core/context.ts'; import type { Tensor } from '../core/tensor.ts'; /** * Root Mean Square Normalization * * Computes: output = (input / sqrt(mean(input^2) + eps)) * weight * * @param ctx WebInfer context * @param input Input tensor of shape [..., hidden_size] * @param weight Weight tensor of shape [hidden_size] * @param eps Small constant for numerical stability (default: 1e-5) * @returns Normalized tensor of same shape as input */ export declare function rmsnorm(ctx: WebInferContext, input: Tensor, weight: Tensor, eps?: number): Promise; /** * Fused Add + RMSNorm * * Computes: output = rmsnorm(input + residual) * Returns both the normalized output and the new residual (input + residual) * * @param ctx WebInfer context * @param input Input tensor * @param residual Residual tensor to add * @param weight Weight tensor * @param eps Small constant for numerical stability (default: 1e-5) * @returns [output, new_residual] tuple */ export declare function fused_add_rmsnorm(ctx: WebInferContext, input: Tensor, residual: Tensor, weight: Tensor, eps?: number): Promise<[Tensor, Tensor]>; /** * Gemma RMSNorm variant (adds 1.0 to weight) * * Computes: output = (input / sqrt(mean(input^2) + eps)) * (weight + 1.0) * * @param ctx WebInfer context * @param input Input tensor * @param weight Weight tensor * @param eps Small constant for numerical stability (default: 1e-5) * @returns Normalized tensor */ export declare function gemma_rmsnorm(ctx: WebInferContext, input: Tensor, weight: Tensor, eps?: number): Promise;