Skip to contents

Concatenates tensors along a dimension.

Usage

nvl_concatenate(..., dimension)

Arguments

...

(tensorish)
Tensors to concatenate. Must all have the same data type, ndims, and shape except along dimension.

dimension

(integer(1))
Dimension along which to concatenate (1-indexed).

Value

tensorish
Has the same data type as the inputs. The output shape matches the inputs in all dimensions except dimension, which is the sum of the input sizes along that dimension. It is ambiguous if all inputs are ambiguous.

Implemented Rules

  • stablehlo

  • backward

StableHLO

Lowers to stablehlo::hlo_concatenate().

See also

Examples

jit_eval({
  x <- nv_tensor(c(1, 2, 3))
  y <- nv_tensor(c(4, 5, 6))
  nvl_concatenate(x, y, dimension = 1L)
})
#> AnvilTensor
#>  1
#>  2
#>  3
#>  4
#>  5
#>  6
#> [ CPUf32{6} ]