pub struct MlxClosureCustomVmap(/* private fields */);Expand description
Owned MLX custom VMAP closure, released exactly once.
Implementations§
Source§impl MlxClosureCustomVmap
impl MlxClosureCustomVmap
Sourcepub fn from_fn<F>(callback: F) -> Result<Self, MlxCError>
pub fn from_fn<F>(callback: F) -> Result<Self, MlxCError>
Builds an owned custom-VMAP closure from a Rust callable that receives inputs and input axes and returns outputs with output axes.
Sourcepub fn set(&mut self, source: &Self) -> Result<(), MlxCError>
pub fn set(&mut self, source: &Self) -> Result<(), MlxCError>
Copies the source closure handle into this handle.
Sourcepub fn apply(
&self,
inputs: &MlxArrayVector,
input_axes: &[i32],
) -> Result<(MlxArrayVector, MlxVectorInt), MlxCError>
pub fn apply( &self, inputs: &MlxArrayVector, input_axes: &[i32], ) -> Result<(MlxArrayVector, MlxVectorInt), MlxCError>
Applies the custom VMAP transform.
§Errors
Returns the captured MLX-C description when application fails.
Trait Implementations§
Source§impl Debug for MlxClosureCustomVmap
impl Debug for MlxClosureCustomVmap
Source§impl Drop for MlxClosureCustomVmap
impl Drop for MlxClosureCustomVmap
Auto Trait Implementations§
impl !Send for MlxClosureCustomVmap
impl !Sync for MlxClosureCustomVmap
impl Freeze for MlxClosureCustomVmap
impl RefUnwindSafe for MlxClosureCustomVmap
impl Unpin for MlxClosureCustomVmap
impl UnsafeUnpin for MlxClosureCustomVmap
impl UnwindSafe for MlxClosureCustomVmap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more