/** * Activation functions */ import type { WebInferContext } from '../core/context.ts'; import type { Tensor } from '../core/tensor.ts'; /** * SiLU (Swish) activation with gating * * Input tensor has shape [..., 2 * hidden_size] * Splits into gate[..., :hidden_size] and up[..., hidden_size:] * Computes: output = silu(gate) * up * Where silu(x) = x * sigmoid(x) = x / (1 + exp(-x)) * * @param ctx WebInfer context * @param input Input tensor of shape [..., 2 * hidden_size] * @returns Activated tensor of shape [..., hidden_size] */ export declare function silu_and_mul(ctx: WebInferContext, input: Tensor): Promise; /** * GELU activation with gating * * Input tensor has shape [..., 2 * hidden_size] * Computes: output = gelu(gate) * up * Where gelu(x) ≈ 0.5 * x * (1 + tanh(sqrt(2/π) * (x + 0.044715 * x^3))) * * @param ctx WebInfer context * @param input Input tensor of shape [..., 2 * hidden_size] * @returns Activated tensor of shape [..., hidden_size] */ export declare function gelu_and_mul(ctx: WebInferContext, input: Tensor): Promise;