Skip to contents

Returns the number of dimensions (sometimes also refered to as rank) of an array. Equivalent to length(shape(x)).

Usage

ndims(x)

Arguments

x

(arrayish)
An array-like object.

Value

integer(1)

See also

Examples

x <- nv_array(1:4, dtype = "f32")
ndims(x)
#> [1] 1