pub struct Jit<F> { /* private fields */ }Expand description
A function compiled with XLA; see jit.
Implementations§
Source§impl<F> Jit<F>
impl<F> Jit<F>
Sourcepub fn with_name(self, name: impl Into<String>) -> Self
pub fn with_name(self, name: impl Into<String>) -> Self
Sets the name shown in the IR (the default is jit).
Sourcepub fn call<I, O>(&self, input: &I) -> O::On<Native>
pub fn call<I, O>(&self, input: &I) -> O::On<Native>
Runs the function on Native values with XLA.
§Panics
Panics if the runtime fails (see Jit::try_call), or if f uses
traced values of another trace.
Sourcepub fn call_on_device<I, O>(
&self,
input: &OnDevice<I>,
) -> OnDevice<O::On<Native>>
pub fn call_on_device<I, O>( &self, input: &OnDevice<I>, ) -> OnDevice<O::On<Native>>
Runs the function with XLA on values on the device, and returns the results on the device.
§Panics
Panics if the runtime fails, or if the values are on another platform.
Sourcepub fn call_on_device_donating<I, O>(
&self,
input: OnDevice<I>,
) -> OnDevice<O::On<Native>>
pub fn call_on_device_donating<I, O>( &self, input: OnDevice<I>, ) -> OnDevice<O::On<Native>>
Jit::call_on_device taking the input, whose buffers the program
may reuse for the results (donation, as with JAX’s
donate_argnums), which saves memory and copies in loops such as
state = step.call_on_device_donating(state). Leaves whose buffers
are shared with another OnDevice (a clone) are not donated.
§Panics
Panics if the runtime fails, or if the values are on another platform.