pub struct Df64LinearizeRule;Expand description
Forward-mode rule for the contribution’s operations.
The total sum is linear, so its tangent output is the sum of the tangent inputs, and each conversion’s tangent passes through the same conversion.
§Examples
use tenferro_ad::semantic_extension::{SemanticExtensionRuleSet, SemanticLinearizeRule};
use tenferro_df64_proof::ad::Df64LinearizeRule;
let rules = SemanticExtensionRuleSet::new()
.with_linearize(std::sync::Arc::new(Df64LinearizeRule))
.expect("one linearize rule per family");
assert!(rules.lookup_linearize("tenferro-df64-proof.df64_ops.v1").is_some());Trait Implementations§
Source§impl Debug for Df64LinearizeRule
impl Debug for Df64LinearizeRule
Source§impl SemanticLinearizeRule for Df64LinearizeRule
impl SemanticLinearizeRule for Df64LinearizeRule
Source§fn family_id(&self) -> &'static str
fn family_id(&self) -> &'static str
Return the versioned extension family handled by this rule.
Source§fn linearize(
&self,
request: SemanticLinearizeRequest<'_>,
builder: &mut SemanticProgramBuilder,
) -> Result<SemanticLinearizeResult, SemanticAdError>
fn linearize( &self, request: SemanticLinearizeRequest<'_>, builder: &mut SemanticProgramBuilder, ) -> Result<SemanticLinearizeResult, SemanticAdError>
Emit ordered tangent outputs and residuals into
builder. Read moreAuto Trait Implementations§
impl Freeze for Df64LinearizeRule
impl RefUnwindSafe for Df64LinearizeRule
impl Send for Df64LinearizeRule
impl Sync for Df64LinearizeRule
impl Unpin for Df64LinearizeRule
impl UnsafeUnpin for Df64LinearizeRule
impl UnwindSafe for Df64LinearizeRule
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
impl<T, U> Imply<T> for U
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