Skip to main content

ClikaRT::ops::deform_conv

function

deform_conv()

Tensor deform_conv(
    Tensor x,
    Tensor weight,
    Tensor offset,
    OptionalTensor mask = {},
    OptionalTensor bias = {},
    ClikaRT::Span<const std::int64_t> stride = {},
    ClikaRT::Span<const std::int64_t> padding = {},
    ClikaRT::Span<const std::int64_t> dilation = {},
    int64_t groups = 1,
    int64_t offset_groups = 1,
    Activation activation = Activation::Identity
)

Deformable convolution, 1-D/2-D/3-D (rank derives from x), channels-last: x [N, D1..Dr, C], weight [O, K1..Kr, C/groups] (OHWI), offset [N, out-spatial..., offset_groups·∏K·r], mask [N, out-spatial..., offset_groups·∏K] (absent ⇒ unmodulated), bias [O]; returns [N, out-spatial..., O] at x's dtype. Each kernel tap samples at out·stride − pad_lo + tap·dilation + Δ (pixel units, bilinear; out-of-bounds reads 0); the offset channel for (group g, tap t, axis d) is (g·∏K + t)·r + d with taps row-major over the kernel and axes in layout order (2-D: Δh then Δw). padding is interleaved (lo, hi) pairs over the spatial axes; stride/dilation broadcast per spatial axis (empty ⇒ 1). All floating inputs must share x's dtype (f32/f64/f16/bf16; no silent promotion); activation is a fused elementwise epilogue applied after bias.

Declared in ClikaRT/compute/ops.h, line 1921