ai.onnx.Concat

ai.onnx · standard ONNX operator · ONNX opset ≥ 13

Description

Concatenates a list of tensors along a single axis into one output tensor. All inputs must have the same shape except along the concatenation axis, which may differ between inputs. Negative axis values count from the end of the rank.

See the ONNX Concat spec for the reference semantics.

Inputs

Name Bind key Logical dtype Rank Shape Description Presence
A a T First input tensor to concatenate. required
B b T Second input tensor to concatenate (optional). optional
D d T Third input tensor to concatenate (optional). optional
E e T Fourth input tensor to concatenate (optional). optional
F f T Fifth input tensor to concatenate (optional). optional
G g T Sixth input tensor to concatenate (optional). optional
H h T Seventh input tensor to concatenate (optional). optional
I i T Eighth input tensor to concatenate (optional). optional
J j T Ninth input tensor to concatenate (optional). optional

Outputs

Name Bind key Logical dtype Rank Shape Description Presence
concat_result c T same as A derived; see description Concatenated output tensor. required

Attributes

Attributes and default values (overridable per request):

Attribute Default Description
axis Required axis along which to concatenate; negative values count from the back, and the accepted range is [-r, r-1] where r is the rank of the inputs.

Type constraints

Variable Allowed dtypes
T float32, float16, uint32, int32, int16, uint8, int8, bool

Files

Use with @huggingface/kernels

The loader derives every required output's shape and logical dtype from the manifest contract and this call. It then allocates the result tensors automatically.

The version: 1 option selects the published kernel contract; it is independent of any operator opset, contrib since_version, or model version.

Replace each *Data placeholder with a typed array containing the corresponding input data.

import { getKernel } from "@huggingface/kernels";

const kernel = await getKernel("webgpu-kernels/ai.onnx.Concat", { version: 1 });
const { c } = await kernel({ a: { data: aData, shape: [1] } }, {
  attrs: { axis: 0 },
});
Downloads last month
-
kernel
webgpu
wgsl
apache-2.0
WebGPU

Requires WebGPU support. See the compatibility table.