Array#
-
enum mlx_array_dtype_#
Array element type.
Values:
-
enumerator MLX_BOOL#
-
enumerator MLX_UINT8#
-
enumerator MLX_UINT16#
-
enumerator MLX_UINT32#
-
enumerator MLX_UINT64#
-
enumerator MLX_INT8#
-
enumerator MLX_INT16#
-
enumerator MLX_INT32#
-
enumerator MLX_INT64#
-
enumerator MLX_FLOAT16#
-
enumerator MLX_FLOAT32#
-
enumerator MLX_BFLOAT16#
-
enumerator MLX_COMPLEX64#
-
enumerator MLX_BOOL#
-
typedef struct mlx_array_ *mlx_array#
An N-dimensional array object.
-
typedef enum mlx_array_dtype_ mlx_array_dtype#
Array element type.
-
mlx_array mlx_array_from_data(const void *data, const int *shape, int dim, mlx_array_dtype dtype)#
New array from existing buffer.
- Parameters:
data – A buffer which will be copied.
shape – Shape of the array.
dim – Number of dimensions (size of
shape
).dtype – Type of array elements.
-
size_t *mlx_array_strides(mlx_array arr)#
The strides of the array.
Returns: a pointer to the sizes of each dimension.
-
int *mlx_array_shape(mlx_array arr)#
The shape of the array.
Returns: a pointer to the sizes of each dimension.
-
mlx_array_dtype mlx_array_get_dtype(mlx_array arr)#
The array element type.
-
const bool *mlx_array_data_bool(mlx_array arr)#
Returns a pointer to the array data, cast to
bool*
.Array must be evaluated, otherwise returns NULL.
-
const uint8_t *mlx_array_data_uint8(mlx_array arr)#
Returns a pointer to the array data, cast to
uint8_t*
.Array must be evaluated, otherwise returns NULL.
-
const uint16_t *mlx_array_data_uint16(mlx_array arr)#
Returns a pointer to the array data, cast to
uint16_t*
.Array must be evaluated, otherwise returns NULL.
-
const uint32_t *mlx_array_data_uint32(mlx_array arr)#
Returns a pointer to the array data, cast to
uint32_t*
.Array must be evaluated, otherwise returns NULL.
-
const uint64_t *mlx_array_data_uint64(mlx_array arr)#
Returns a pointer to the array data, cast to
uint64_t*
.Array must be evaluated, otherwise returns NULL.
-
const int8_t *mlx_array_data_int8(mlx_array arr)#
Returns a pointer to the array data, cast to
int8_t*
.Array must be evaluated, otherwise returns NULL.
-
const int16_t *mlx_array_data_int16(mlx_array arr)#
Returns a pointer to the array data, cast to
int16_t*
.Array must be evaluated, otherwise returns NULL.
-
const int32_t *mlx_array_data_int32(mlx_array arr)#
Returns a pointer to the array data, cast to
int32_t*
.Array must be evaluated, otherwise returns NULL.
-
const int64_t *mlx_array_data_int64(mlx_array arr)#
Returns a pointer to the array data, cast to
int64_t*
.Array must be evaluated, otherwise returns NULL.