Skip to main content

plan_bilateral_fusion

Function plan_bilateral_fusion 

Source
pub fn plan_bilateral_fusion(
    dims: &[usize],
    src_strides: &[isize],
    dst_strides: &[isize],
) -> Result<BilateralFusionPlan, FusionPlanError>
Expand description

Plan bilateral dimension fusion for source and destination layouts.

Size-one axes are removed. Two remaining adjacent axes are fused only when each layout is affine-contiguous across the boundary. Negative strides are supported; stride multiplication overflow simply prevents fusion.

ยงErrors

Returns FusionPlanError::LengthMismatch when the metadata ranks differ, and FusionPlanError::DimensionOverflow when a dimension cannot participate safely in isize stride arithmetic or a fused extent overflows usize.