Skip to contents

Removes dimensions of size 1 from an array.

Usage

nv_squeeze(operand, dims = NULL)

Arguments

operand

(arrayish)
Operand.

dims

(integer() | NULL)
Dimensions to squeeze. If NULL (default), all dimensions of size 1 are removed.

Value

arrayish
Has the same data type as operand with the specified dimensions removed.

Examples

x <- nv_array(1:6, shape = c(1, 6, 1))
nv_squeeze(x)
#> AnvlArray
#>  1
#>  2
#>  3
#>  4
#>  5
#>  6
#> [ CPUi32{6} ]