Skip to main content

MlxArrayVector

Struct MlxArrayVector 

Source
pub struct MlxArrayVector(/* private fields */);
Expand description

Temporary MLX vector that retains array handles for one aggregate operation.

Implementations§

Source§

impl MlxArrayVector

Source

pub fn empty(operation: &'static str) -> Result<Self, MlxCError>

Source

pub fn new(arrays: &[&MlxArray]) -> Result<Self, MlxCError>

Source

pub const fn raw(&self) -> mlx_vector_array

Source

pub fn raw_mut(&mut self) -> *mut mlx_vector_array

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Reports whether the vector holds no arrays.

Source

pub fn array_at( &self, output_index: usize, operation: &'static str, ) -> Result<MlxArray, MlxCError>

Source

pub fn set(&mut self, source: &Self) -> Result<(), MlxCError>

Copies the source vector handle into this handle.

Source

pub fn from_array(array: &MlxArray) -> Result<Self, MlxCError>

Creates an owned vector holding one copied array handle.

Source

pub fn set_arrays(&mut self, arrays: &[MlxArray]) -> Result<(), MlxCError>

Replaces the vector contents with copies of the provided arrays.

Source

pub fn set_one(&mut self, array: &MlxArray) -> Result<(), MlxCError>

Replaces the vector contents with one copied array handle.

Source

pub fn append_array(&mut self, array: &MlxArray) -> Result<(), MlxCError>

Appends one copied array handle.

Source

pub fn append_arrays(&mut self, arrays: &[MlxArray]) -> Result<(), MlxCError>

Appends copies of the provided array handles.

Trait Implementations§

Source§

impl Debug for MlxArrayVector

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for MlxArrayVector

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.