Skip to contents

Concatenates arrays along a dimension. Operands are promoted to a common data type and scalars are broadcast before concatenation.

Usage

nv_concatenate(..., dimension = NULL)

Arguments

...

(arrayish)
Arrays to concatenate. Must have the same shape except along dimension.

dimension

(integer(1) | NULL)
Dimension along which to concatenate. If NULL (default), assumes all inputs are at most 1-D and concatenates along dimension 1.

Value

arrayish
Has the common data type and a shape matching the inputs in all dimensions except dimension, which is the sum of input sizes.

See also

prim_concatenate() for the underlying primitive.

Examples

x <- nv_array(c(1, 2, 3))
y <- nv_array(c(4, 5, 6))
nv_concatenate(x, y)
#> AnvlArray
#>  1
#>  2
#>  3
#>  4
#>  5
#>  6
#> [ CPUf32{6} ]