pub struct Vmap<I, O, F> { /* private fields */ }Expand description
A function vectorized over batch axes (vmap): configure it with
Vmap::in_axes/Vmap::out_axes, then call it with Vmap::call or turn it into a
closure with Vmap::into_fn (to compose with compile and the other transforms).
Implementations§
Source§impl<I: Tree, O: Tree, F> Vmap<I, O, F>
impl<I: Tree, O: Tree, F> Vmap<I, O, F>
Sourcepub fn in_axes(self, axes: impl InAxes) -> Self
pub fn in_axes(self, axes: impl InAxes) -> Self
The batch axis of each top-level argument (None: shared by every example), or one
axis for all: in_axes((None, 0)), in_axes(1). Negative axes count from the end.
Sourcepub fn out_axes(self, axes: impl OutAxes) -> Self
pub fn out_axes(self, axes: impl OutAxes) -> Self
The axis where each top-level output gets the batch dimension, or one for all.
Auto Trait Implementations§
impl<I, O, F> Freeze for Vmap<I, O, F>
impl<I, O, F> RefUnwindSafe for Vmap<I, O, F>
impl<I, O, F> Send for Vmap<I, O, F>
impl<I, O, F> Sync for Vmap<I, O, F>
impl<I, O, F> Unpin for Vmap<I, O, F>
impl<I, O, F> UnsafeUnpin for Vmap<I, O, F>
impl<I, O, F> UnwindSafe for Vmap<I, O, F>
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more