pub enum LinalgAdRoute {
Unsupported,
Linearize,
LinearizeThenTranspose,
LinearizeThenCustomLinearTranspose,
CustomVjp,
CustomPreferredWithLinearizeFallback,
}Expand description
Implementation route used for a user-visible AD mode.
§Examples
use tenferro_linalg::{linalg_ad_support, LinalgAdOpKind, LinalgAdRoute};
let svd = linalg_ad_support(LinalgAdOpKind::Svd);
assert_eq!(svd.vjp.route, LinalgAdRoute::LinearizeThenTranspose);Variants§
Unsupported
No supported route exists.
Linearize
The mode is emitted directly by the operation’s linearize rule.
LinearizeThenTranspose
Reverse mode is supported by linearizing the primal graph and then transposing that linear graph.
LinearizeThenCustomLinearTranspose
Reverse mode is supported by linearizing the primal graph and using a custom transposed-linear rule for the emitted linear operation.
CustomVjp
Reverse mode is emitted by a direct operation-specific primal VJP rule.
CustomPreferredWithLinearizeFallback
A custom VJP is preferred, with the canonical linearize-then-transpose route retained as an intentional not-applicable fallback.
Trait Implementations§
Source§impl Clone for LinalgAdRoute
impl Clone for LinalgAdRoute
Source§fn clone(&self) -> LinalgAdRoute
fn clone(&self) -> LinalgAdRoute
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 moreSource§impl Debug for LinalgAdRoute
impl Debug for LinalgAdRoute
Source§impl PartialEq for LinalgAdRoute
impl PartialEq for LinalgAdRoute
Source§fn eq(&self, other: &LinalgAdRoute) -> bool
fn eq(&self, other: &LinalgAdRoute) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for LinalgAdRoute
impl Eq for LinalgAdRoute
impl StructuralPartialEq for LinalgAdRoute
Auto Trait Implementations§
impl Freeze for LinalgAdRoute
impl RefUnwindSafe for LinalgAdRoute
impl Send for LinalgAdRoute
impl Sync for LinalgAdRoute
impl Unpin for LinalgAdRoute
impl UnsafeUnpin for LinalgAdRoute
impl UnwindSafe for LinalgAdRoute
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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