Skip to contents

Get length of MLX array

Usage

# S3 method for class 'mlx'
length(x)

Arguments

x

An mlx array, or an R array/matrix/vector that will be converted via as_mlx().

Value

Total number of elements

Examples

x <- as_mlx(matrix(1:6, 2, 3))
length(x)
#> [1] 6