Skip to main content

ClikaRT::ops::conv

function

conv()

Tensor conv(
    Tensor x,
    Tensor weight,
    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,
    PadMode mode = PadMode::Constant,
    std::optional<double> value = std::nullopt,
    Activation activation = Activation::Identity
)

Convolution family, channels-last ([N, spatial..., C]), weights output-channel-first ([O, spatial..., Ig]). stride / dilation / output_padding are PER-AXIS window attributes everywhere: length 0 (defaulted), 1 (broadcast), or spatial-rank. padding carries TWO conventions; read the one that matches the op:

  • conv / conv_transpose*: interleaved (lo, hi) PAIRS in axis order (even length; pair i pads spatial axis i); asymmetric pads spell directly, e.g. 1-D {2, 3} = lo 2, hi 3.
  • conv1d/2d/3d: SYMMETRIC per-axis widths (length 0/1/spatial-rank), e.g. 1-D {2} = lo 2, hi 2; an asymmetric pad needs conv or an explicit ops::pad first. The inline defaults below encode the split: conv1d pads {0}, conv_transpose1d pads {0, 0}.

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