Skip to contents

Inserts a dimension of size 1 at the specified position.

Usage

nv_unsqueeze(operand, dim)

Arguments

operand

(arrayish)
Operand.

dim

(integer(1))
Position at which to insert the new dimension.

Value

arrayish
Has the same data type as operand with an extra dimension of size 1.

Examples

x <- nv_array(c(1, 2, 3))
nv_unsqueeze(x, dim = 1L)
#> AnvlArray
#>  1 2 3
#> [ CPUf32{1,3} ]