pub struct MlxClosureCustomJvp(/* private fields */);Expand description
Owned MLX custom JVP closure, released exactly once.
Implementations§
Source§impl MlxClosureCustomJvp
impl MlxClosureCustomJvp
Sourcepub fn from_fn<F>(callback: F) -> Result<Self, MlxCError>
pub fn from_fn<F>(callback: F) -> Result<Self, MlxCError>
Builds an owned custom-JVP closure from a Rust callable that receives primals, tangents, and the requested output indices.
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,
primals: &MlxArrayVector,
tangents: &MlxArrayVector,
output_indices: &[i32],
) -> Result<MlxArrayVector, MlxCError>
pub fn apply( &self, primals: &MlxArrayVector, tangents: &MlxArrayVector, output_indices: &[i32], ) -> Result<MlxArrayVector, MlxCError>
Applies the custom JVP transform.
§Errors
Returns the captured MLX-C description when application fails.
Trait Implementations§
Source§impl Debug for MlxClosureCustomJvp
impl Debug for MlxClosureCustomJvp
Source§impl Drop for MlxClosureCustomJvp
impl Drop for MlxClosureCustomJvp
Auto Trait Implementations§
impl !Send for MlxClosureCustomJvp
impl !Sync for MlxClosureCustomJvp
impl Freeze for MlxClosureCustomJvp
impl RefUnwindSafe for MlxClosureCustomJvp
impl Unpin for MlxClosureCustomJvp
impl UnsafeUnpin for MlxClosureCustomJvp
impl UnwindSafe for MlxClosureCustomJvp
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