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_shape
def roi_align_shape(input: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=input.static_spec], rois: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=rois.static_spec], output_height: Int64, output_width: Int64, spatial_scale: Scalar, sampling_ratio: Scalar) -> IndexList[Int(4)]
Computes the output shape for the mo.roi_align graph op.
Args:
- βinput (
ManagedTensorSlice[IOSpec[_, _].Input, static_spec=input.static_spec]): Rank-4 batched image input in NHWC format with shape(N, H, W, C). - βrois (
ManagedTensorSlice[IOSpec[_, _].Input, static_spec=rois.static_spec]): Rank-2 tensor of ROI box coordinates with shape(M, 5)where each row is(batch_idx, y0, x0, y1, x1). - βoutput_height (
Int64): Pooled output height, in elements. - βoutput_width (
Int64): Pooled output width, in elements. - βspatial_scale (
Scalar): Scale factor remapping ROI coordinates to input coordinates. - βsampling_ratio (
Scalar): Number of sampling points in the interpolation grid used to compute each pooled bin.
Returns:
IndexList[Int(4)]: The output shape (num_rois, output_height, output_width, channels).