Last updated: 2026-06-12

Inference Runtime

Sigmoid Mul

All API Sections

T-CPU sigmoid-gated multiply implementation.

Computes: output[i] = sigmoid(gate[i]) * x[i] Used for attention gating (Q-gate) and SSM gated norm.

2 exports shown

struct

Params

#
pub const Params = struct

Inputs and outputs for one sigmoid-gated multiply.

Parameters

gate
Pre-activation gate values; sigmoid is applied element-wise.
x
Companion values multiplied by the sigmoid of `gate`.
output
Destination vector of length `>= gate.len`.

src/zinc_rt/isa/cpu_zig/sigmoid_mul.zig:11

function

run

#
pub fn run(params: Params) !void

Compute `output[i] = sigmoid(gate[i]) * x[i]` for every gate element.

Used by attention Q-gating and SSM gated-norm paths where a learned scalar selects how much of `x` to pass through. is shorter than `gate`, otherwise void.

Parameters

params
Gate, value, and output slices; see `Params`.

Returns

`error.EmptyInput` when `gate` is empty, `error.ShapeMismatch` when `output` or `x`

src/zinc_rt/isa/cpu_zig/sigmoid_mul.zig:23