Skip to main content

ClikaRT::ops::conv3d

function

conv3d()

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

3-D convolution over a channels-last input.

Layout is channels-last: input [N, spatial.., C], weight OHWI [O, K.., C/groups] (output channels first, kernel dims, then the per-group input channels), optional bias [O].

Parameters

  • x: [N, D1..D3, C].
  • weight: [O, K1..K3, C/groups] (OHWI).
  • bias: optional [O].
  • stride: per-dim strides. Default {1, 1, 1}.
  • padding: per-dim zero padding. Default {0, 0, 0}.
  • dilation: per-dim kernel dilation. Default all 1.
  • groups: channel groups; C and O must divide by it. Default 1.

Throws

  • ClikaRT::Error: when the channel/group arithmetic or a span length is inconsistent, or the dtype is not served (code_name() carries the reason).

Returns: [N, out-spatial.., O]; each spatial dim per the usual conv arithmetic (in + 2*pad - dilation*(K-1) - 1)/stride + 1.

auto y = ClikaRT::ops::conv3d(x, w, b); // channels-last in, [N, .., O] out

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