R/api.R
nv_unsqueeze.Rd
Inserts a dimension of size 1 at the specified position.
nv_unsqueeze(operand, dim)
(arrayish) Operand.
arrayish
(integer(1)) Position at which to insert the new dimension.
integer(1)
arrayish Has the same data type as operand with an extra dimension of size 1.
operand
nv_squeeze(), nv_reshape()
nv_squeeze()
nv_reshape()
x <- nv_array(c(1, 2, 3)) nv_unsqueeze(x, dim = 1L) #> AnvlArray #> 1 2 3 #> [ CPUf32{1,3} ]