IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
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

roi_align_kernel

def roi_align_kernel[InputLayoutType: TensorLayout, input_origin: ImmOrigin, OutputLayoutType: TensorLayout, output_origin: MutOrigin, RoisLayoutType: TensorLayout, rois_origin: ImmOrigin, dtype: DType, InputEngine: TensorEngine, OutputEngine: TensorEngine, RoisEngine: TensorEngine, aligned: Bool, mode: StaticString](input_tensor: TileTensor[dtype, InputLayoutType, input_origin, Engine=InputEngine], output_tensor: TileTensor[dtype, OutputLayoutType, output_origin, Engine=OutputEngine], rois_tensor: TileTensor[dtype, RoisLayoutType, rois_origin, Engine=RoisEngine], pooled_height: Int32, pooled_width: Int32, spatial_scale: Float32, sampling_ratio: Float32, rows_per_block: Int32, total_rows: Int32)

One thread per output element [ri, ph, pw, c].

The block's x dimension strides the channel axis (32 channels per pass); the y dimension strides the pooled (ph, pw) rows assigned to the block. The grid spans the region axis, chunked by rows_per_block; each block grid-strides its assigned rows and channels so the launch covers every output element.

Was this page helpful?