---
title: "ClikaRT::ops::causal_conv_update"
sidebar_label: "causal_conv_update"
description: "Depthwise causal short-conv serving step over a rolling per-sequence window."
---

<!-- Generated by tools/doxygen2mdx from Doxygen XML. Do not edit. -->

<span class="api-kind api-kind--function">function</span>

## causal\_conv\_update() {#causal_conv_update}

<div class="api-signature">

[`Tensor`](../Tensor.md) **`causal_conv_update`**(<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`Tensor`](../Tensor.md) `input`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`Tensor`](../Tensor.md) `weight`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`OptionalTensor`](../../index.md#OptionalTensor) `bias`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`Tensor`](../Tensor.md) `state`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`OptionalTensor`](../../index.md#OptionalTensor) `seq_lens` `=` `{}`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`OptionalTensor`](../../index.md#OptionalTensor) `slot_ids` `=` `{}`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;`std::optional<`[`Activation`](./index.md#Activation)`>` `activation` `=` `std::nullopt`<br />
)

</div>

Depthwise causal short-conv serving step over a rolling per-sequence window. `x [B, S, dim]`; `weight [dim, W]` (oldest tap first); optional `bias [dim]`; `state [B, dim, W]` (same dtype as x) is read AND updated IN PLACE in both modes: S \> 1 runs the prefill conv with each row's left context seeded from its window (a zero window is a fresh sequence, bit for bit; an S-token call over committed state equals S single-token steps exactly) and re-captures the window as the last W of (old window ++ the row's valid inputs; zero valid tokens leave it unchanged); S == 1 shift-inserts the new token and emits the tap dot. `seq_lens` (`[B]` Int32) bounds ragged prefill rows (their padding is zero post-activation). `activation` applies to the returned `out [B, S, dim]` only (Silu fuses in-kernel); the stored window stays pre-activation raw. `slot_ids` (`[B]` Int32, device-resident) addresses `state` as a SLAB `[num_slots, dim, W]`: batch row `b` reads/updates slab row `slot_ids[b]` in place (ids in range and DISTINCT per call, the caller's contract); absent keeps state row `b`.

<div class="api-declared">

Declared in `ClikaRT/compute/ops.h`, line 3849

</div>
