concat

dragon.concat(
  inputs,
  axis=0,
  **kwargs
)[source]

Concatenate the inputs along the given axis.

All dimensions except the axis should be same:

x1 = dragon.ones(shape=(2, 3))
x2 = dragon.zeros(shape=(2, 4))
y = dragon.concat([x1, x2], axis=1)  # Ok
z = dragon.concat([x1, x2], axis=0)  # Wrong

axis can be negative:

x = dragon.constant([[1, 2], [3, 4]])
y = dragon.concat([x, x], axis=1)
z = dragon.concat([x, x], axis=-1)  # Equivalent
Parameters:
  • inputs (Sequence[dragon.Tensor]) The input tensors.
  • axis (int, optional, default=0) The axis to concatenate.
Returns:

dragon.Tensor The output tensor.