Sliding Average Async Task¶
The Sliding Average async task maintains a rolling mean of the most recent window_size frames entirely on the GPU.
Note
The internal buffer is provisioned with target_capacity + window_size slots in device memory. The extra target_capacity slots absorb producer/consumer latency.
Inputs¶
This task consumes a tensor per push with shape (1, H, W), where:
1: unit batch size (exactly one frame per push)H,W: frame height and width
The tensor must be 32-bit floating point (float32) data already located in device memory. acquire_input returns a writable view that aliases the internal circular buffer.
An optional second input may provide a host uint8 scalar with shape (1). A zero value discards
the associated frame without advancing the averaging window; a nonzero value accepts it. This is
available for data-dependent filtering.
discard_first deterministically discards the requested number of initial accepted frames without
advancing the averaging window. The VSH correction pipeline uses this to suppress its known
window_size - 1 alignment warm-up without adding a validity edge to the graph.
Outputs¶
After the warm-up period required to enqueue the first window_size frames, each pop exposes one tensor of shape (1, H, W) with the same dtype and memory location as the input.
Inplace¶
This task does not perform inplace propagation between its input and output tensors.
Ownership¶
The task owns both the input and output storage it exposes.
Settings¶
Example:
| Property | Pattern | Type | Deprecated | Definition | Title/Description |
|---|---|---|---|---|---|
| + target_capacity | No | integer | No | - | Number of extra frames the circular buffer can hold beyond the averaging window. Must satisfy: - target_capacity > 0 |
| + window_size | No | integer | No | - | Number of frames included in each running average. Must satisfy: - window_size > 0 |