Skip to main content
Log in

Mojo function

concat

concat(values: List[Symbol], axis: Int = 0, out_dim: Optional[Dim] = Optional(None)) -> Symbol

Concatenates a list of symbolic tensors along an axis.

Args:

  • values (List[Symbol]): A list of symbolic tensor values. Each tensor must have the same dtype and rank, and must have the same dimension size for each dimension other than axis.
  • axis (Int): The axis to concatenate along. If negative, indexes relative to the end of the tensor shape. For instance, concat(vs, -1) will concat along the last dimension.
  • out_dim (Optional[Dim]): The expected output dimension of the concat axis. This will be assert at graph execution time to be correct.

Returns:

A new symbolic tensor representing the concatenation result. It will have the same rank as each input tensor, and its dimenions will be the same as each input tensor's for each dimension other than axis, which will have size equal to the sum of all tensor's size for that dimension.