mlx_rs::transforms::compile

Trait Compile

Source
pub trait Compile<A, O, E>: Sized {
    type Args<'a>;

    // Required method
    fn compile<'args>(
        self,
        shapeless: bool,
    ) -> impl CallMut<Self::Args<'args>, O, E>;
}
Expand description

A trait for functions that can be compiled.

§Generic parameters

  • A: The type of the array arguments
  • O: The type of the output
  • E: The type of the error

Required Associated Types§

Source

type Args<'a>

The type of the arguments that the returned closure takes.

This is needed to relax the lifetime requirements of the returned closure. Otherwise, the arguments to the returned closure would have to live longer than the closure itself.

Required Methods§

Source

fn compile<'args>( self, shapeless: bool, ) -> impl CallMut<Self::Args<'args>, O, E>

Compiles the function.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<F> Compile<&Array, Array, ()> for F
where F: FnMut(&Array) -> Array + 'static,

Source§

type Args<'a> = &'a Array

Source§

impl<F> Compile<&Array, Array, Exception> for F
where F: FnMut(&Array) -> Result<Array, Exception> + 'static,

Source§

type Args<'a> = &'a Array

Source§

impl<F> Compile<&[Array], Vec<Array>, ()> for F
where F: FnMut(&[Array]) -> Vec<Array> + 'static,

Source§

type Args<'a> = &'a [Array]

Source§

impl<F> Compile<&[Array], Vec<Array>, Exception> for F
where F: FnMut(&[Array]) -> Result<Vec<Array>, Exception> + 'static,

Source§

type Args<'a> = &'a [Array]

Source§

impl<F> Compile<(&Array, &Array), Array, ()> for F
where F: FnMut((&Array, &Array)) -> Array + 'static,

Source§

type Args<'a> = (&'a Array, &'a Array)

Source§

impl<F> Compile<(&Array, &Array), Array, Exception> for F
where F: FnMut((&Array, &Array)) -> Result<Array, Exception> + 'static,

Source§

type Args<'a> = (&'a Array, &'a Array)

Source§

impl<F> Compile<(&Array, &Array, &Array), Array, ()> for F
where F: FnMut((&Array, &Array, &Array)) -> Array + 'static,

Source§

type Args<'a> = (&'a Array, &'a Array, &'a Array)

Source§

impl<F> Compile<(&Array, &Array, &Array), Array, Exception> for F
where F: FnMut((&Array, &Array, &Array)) -> Result<Array, Exception> + 'static,

Source§

type Args<'a> = (&'a Array, &'a Array, &'a Array)