crates/mohu-array/src/array.rs contains a single empty line. The typed N-dimensional array wrapper (NdArray<T>) that should sit above Buffer and provide the primary user-facing Rust API does not exist.
Buffer handles raw bytes, dtype, layout and strides but has no generic type parameter. All methods on Buffer (e.g. as_slice::<T>, get::<T>) require callers to specify the type at every call site. NdArray<T> is the layer that fixes T at construction and provides ergonomic element access, arithmetic operators, and Display.
Minimum scope:
pub struct NdArray<T: Scalar> {
buffer: Buffer,
_marker: PhantomData<T>,
}
with Deref<Target = Buffer>, typed constructors (zeros, ones, from_vec), and Index/IndexMut implementations.
File: crates/mohu-array/src/array.rs (currently 1 line)
Signed-off-by: mohu-org atrancendentbeing@gmail.com
crates/mohu-array/src/array.rscontains a single empty line. The typed N-dimensional array wrapper (NdArray<T>) that should sit aboveBufferand provide the primary user-facing Rust API does not exist.Bufferhandles raw bytes, dtype, layout and strides but has no generic type parameter. All methods onBuffer(e.g.as_slice::<T>,get::<T>) require callers to specify the type at every call site.NdArray<T>is the layer that fixesTat construction and provides ergonomic element access, arithmetic operators, and Display.Minimum scope:
with
Deref<Target = Buffer>, typed constructors (zeros,ones,from_vec), andIndex/IndexMutimplementations.File:
crates/mohu-array/src/array.rs(currently 1 line)Signed-off-by: mohu-org atrancendentbeing@gmail.com