Tensor Concat

Shipping
tensor_concat

Concatenate up to four arrays along an existing axis (numpy concatenate); no new dimension

Signature

Inputs

  • aVector|Matrix|TensorrequiredFirst array to concatenate.
  • bVector|Matrix|TensorrequiredSecond array; every non-concat dimension must match `a`.
  • cVector|Matrix|TensorOptional third array with matching non-concat dims.
  • dVector|Matrix|TensorOptional fourth array with matching non-concat dims.

Outputs

  • resultVector|Matrix|TensorThe joined array; same rank as the inputs, with the concat axis extended by the sum of input extents.

Parameters

KeyTypeDefaultNotes
axisint0Existing axis to join along (negative counts from the end). All other dimensions must match.

Description

Tensor Concat joins up to four arrays along an existing axis, matching numpy's concatenate(axis=…) for n-d arrays. Inputs a and b are required; c and d are optional. This is distinct from the 1-D concat node, which joins Signals/Vectors end-to-end; use this one for general N-D arrays.

The axis parameter selects the existing dimension to extend (negative counts from the end). Every other dimension must match across all inputs — only the concat axis grows, by the sum of the inputs' extents along it. The result keeps the same rank as the inputs (contrast with tensor_stack, which adds a new axis).

Unit handling: concatenation is a pure regrouping. If every input carries the same unit, it is preserved (joining [m] arrays stays [m]); a disagreement — or mixing unitful and unitless — yields a dimensionless result. For unit-preserving joins of 1-D Signals/Vectors specifically, prefer the dedicated concat node.

Mathematics

Examples

Row-wise concat

Wire a matrix [[1,2]] into a and a matrix [[3,4],[5,6]] into b with axis = 0. Axis 0 extends from rows:

[[1, 2],
 [3, 4],
 [5, 6]]

Unit-preserving vector join

Concatenate two vectors both in metres — [1,2] (m) and [3] (m) — along axis = 0. The result [1,2,3] keeps the unit m. If one had been in seconds, the result would be dimensionless.

Widening along the last axis

With axis = -1, two and matrices (same ) join into an matrix — extending columns instead of rows.

Applications

  • Appending new rows or columns to a growing data table represented as a matrix.
  • Joining segments of a longer array that were processed in pieces, back into one contiguous array.
  • Widening a feature matrix by concatenating additional feature blocks along the column axis.

Neat

shared_input_unit is a light field read (no array clone): it walks the wired ports and returns the common unit or empty on the first disagreement, so unit reconciliation costs nothing beyond a few string compares.

The module explicitly distinguishes itself from the 1-D concat node — this one is dimensionless-on-mismatch for arbitrary rank, the other is the unit-preserving Signal/Vector end-to-end joiner.

Unwired optional ports are skipped during collection, so you can concat 2, 3, or 4 arrays without rewiring parameter counts.

Known issues

Every non-concat dimension must match exactly; a mismatch is an error — concat does not broadcast or pad.

Mixed or partial units drop the result to dimensionless silently rather than raising.

For 1-D unit-preserving Signal/Vector joins the separate concat node is the intended tool; this node targets general N-D arrays.

See also

tensorarrayconcatenatejoinnumpyaxisstateless