Skip to main content

ClikaRT::ops::concat

function

concat()

Tensor concat(
    ClikaRT::Span<const Tensor> tensors,
    int64_t dim = 0,
    Activation activation = Activation::Identity
)

Join tensors along an EXISTING dim: all inputs share rank and off-dim extents; the dim extents add up. Copies into fresh storage.

The optional activation fuses an elementwise epilogue into the single copy pass (act(concat(...))): it requires a float output dtype, every input already AT that dtype, and a non-gated kind; anything else raises. Activation::Identity (the default) is the plain join.

Throws

  • ClikaRT::Error: (INVALID_ARGUMENT) when ranks or off-dim extents disagree, or the fused-activation preconditions fail (code_name() carries the reason).

Returns: a new tensor; dim's extent is the inputs' sum.

auto gateup = ClikaRT::ops::concat({gate, up}, /*dim=*/-1);

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