std :: ml::attention
Function std::gated_attention_forward
&FloatTensor gated_attention_forward(
const &FloatTensor Q,
const &FloatTensor K,
const &FloatTensor V,
const &FloatTensor gateLogits,
)Output gating: sigmoid(gateLogits) elementwise-multiplied into the attention result before it's returned (the pattern used e.g. to modulate an attention block's contribution to the residual stream). 'gateLogits' must match the output shape: [seqLen, headDim] for gated_attention_forward, [seqLen, dModel] for gated_mha_forward.