pub struct CustomFunctionFlat { /* private fields */ }Expand description
A function of positional arrays with custom transform rules; see
custom_function_flat.
Implementations§
Source§impl CustomFunctionFlat
impl CustomFunctionFlat
Sourcepub fn with_vjp(
self,
rule: impl Fn(&[Array], &[Array], &[Array]) -> Result<Vec<Array>, Error> + Send + Sync + 'static,
) -> CustomFunctionFlat
pub fn with_vjp( self, rule: impl Fn(&[Array], &[Array], &[Array]) -> Result<Vec<Array>, Error> + Send + Sync + 'static, ) -> CustomFunctionFlat
Sets the reverse-mode rule: (primals, outputs, cotangents) → one cotangent per
primal.
Sourcepub fn with_jvp(
self,
rule: impl Fn(&[Array], &[Array]) -> Result<Vec<Array>, Error> + Send + Sync + 'static,
) -> CustomFunctionFlat
pub fn with_jvp( self, rule: impl Fn(&[Array], &[Array]) -> Result<Vec<Array>, Error> + Send + Sync + 'static, ) -> CustomFunctionFlat
Sets the forward-mode rule: (primals, tangents) → one tangent per output (missing
input tangents are passed as zeros).
Trait Implementations§
Source§impl Clone for CustomFunctionFlat
impl Clone for CustomFunctionFlat
Source§fn clone(&self) -> CustomFunctionFlat
fn clone(&self) -> CustomFunctionFlat
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for CustomFunctionFlat
impl !UnwindSafe for CustomFunctionFlat
impl Freeze for CustomFunctionFlat
impl Send for CustomFunctionFlat
impl Sync for CustomFunctionFlat
impl Unpin for CustomFunctionFlat
impl UnsafeUnpin for CustomFunctionFlat
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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