pub struct VjpFn<F> { /* private fields */ }Expand description
See vjp.
Implementations§
Source§impl<F> VjpFn<F>
impl<F> VjpFn<F>
Sourcepub fn call<I, O>(
&self,
primals: &I,
cotangents: &O::On<Native>,
) -> (O::On<Native>, I)
pub fn call<I, O>( &self, primals: &I, cotangents: &O::On<Native>, ) -> (O::On<Native>, I)
Computes the outputs and the cotangents of the inputs with the interpreter.
§Panics
Panics if the cotangents do not have the types of the outputs, or if a primitive has no differentiation rule.
Sourcepub fn call_traced<I, O>(&self, primals: I, cotangents: O) -> (O, I)
pub fn call_traced<I, O>(&self, primals: I, cotangents: O) -> (O, I)
Computes the outputs and the cotangents of the inputs inside another trace.
§Panics
See VjpFn::call.
Trait Implementations§
Auto Trait Implementations§
impl<F> Freeze for VjpFn<F>where
F: Freeze,
impl<F> RefUnwindSafe for VjpFn<F>where
F: RefUnwindSafe,
impl<F> Send for VjpFn<F>where
F: Send,
impl<F> Sync for VjpFn<F>where
F: Sync,
impl<F> Unpin for VjpFn<F>where
F: Unpin,
impl<F> UnsafeUnpin for VjpFn<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for VjpFn<F>where
F: UnwindSafe,
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