For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Mojo function
tpool_patch_merger
def tpool_patch_merger[dtype: DType, output_layout: TensorLayout, x_layout: TensorLayout, bounds_layout: TensorLayout, OutputStorage: TensorStorage = PointerStorage, XStorage: TensorStorage = PointerStorage, BoundsStorage: TensorStorage = PointerStorage](output: TileTensor[dtype, output_layout, MutAnyOrigin, Storage=OutputStorage], x: TileTensor[dtype, x_layout, ImmutAnyOrigin, Storage=XStorage], bounds: TileTensor[DType.int64, bounds_layout, ImmutAnyOrigin, Storage=BoundsStorage], kH: Int, kW: Int, max_h: Int, max_w: Int, ctx: DeviceContext)
Temporal pooling patch merger entry point.
Parameters:
- dtype (
DType): Element type of the input and output tensors. - output_layout (
TensorLayout): Memory layout of the output tensor. - x_layout (
TensorLayout): Memory layout of the input tensor. - bounds_layout (
TensorLayout): Memory layout of the bounds tensor. - OutputStorage (
TensorStorage): Storage policy of the output tensor. - XStorage (
TensorStorage): Storage policy of the input tensor. - BoundsStorage (
TensorStorage): Storage policy of the bounds tensor.
Args:
- output (
TileTensor[dtype, output_layout, MutAnyOrigin, Storage=OutputStorage]): Contiguous output tensor [total_output_patches, D]. - x (
TileTensor[dtype, x_layout, ImmutAnyOrigin, Storage=XStorage]): Input tensor [n_tokens, D]. - bounds (
TileTensor[DType.int64, bounds_layout, ImmutAnyOrigin, Storage=BoundsStorage]): Grid dimensions tensor [n_vids, 3] with (T, H, W) per video. - kH (
Int): Merge kernel height. - kW (
Int): Merge kernel width. - max_h (
Int): Maximum H across all videos (for grid sizing). - max_w (
Int): Maximum W across all videos (for grid sizing). - ctx (
DeviceContext): Device context.