Skip to main content

Module prelude

Module prelude 

Source
Expand description

The everyday names in one import: use nuvec_core::prelude::*;. Operations are methods of Array; the free functions (MLX’s names) are in ops, best imported as a module (use nuvec_core::ops as mx;, then mx::zeros([2, 3], DType::F32)).

Re-exports§

pub use crate::Array;
pub use crate::DType;
pub use crate::Ellipsis;
pub use crate::Error;
pub use crate::NewAxis;
pub use crate::Result;
pub use crate::Step;
pub use crate::array;
pub use crate::array;
pub use crate::with_stream;

Macros§

array
An array from nested literals, as MLX’s mx.array([...]): the macro’s brackets are the outermost dimension, so array![1, 2, 3] is 1-D and array![[1.0, 2.0], [3.0, 4.0]] is 2-D (up to 4-D). Unsuffixed float literals give float32 and unsuffixed integers int32; suffixed literals keep their type (array![1u8, 2, 3] is uint8), except f64, which gives float32 like MLX’s Python floats (use Array::from for a float64 array). Ragged rows do not compile.