pub trait ADKey:
Clone
+ Debug
+ Hash
+ Eq
+ Send
+ Sync
+ 'static {
// Required method
fn tangent_of(&self, pass: DiffPassId) -> Self;
}Expand description
Constraint on GraphOperation::InputKey for AD use.
tidu uses this trait to generate tangent input keys during
crate::linearize.
§Examples
use tidu::{ADKey, DiffPassId};
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
enum MyKey {
User(String),
Tangent { of: Box<MyKey>, pass: DiffPassId },
}
impl ADKey for MyKey {
fn tangent_of(&self, pass: DiffPassId) -> Self {
MyKey::Tangent {
of: Box::new(self.clone()),
pass,
}
}
}Required Methods§
Sourcefn tangent_of(&self, pass: DiffPassId) -> Self
fn tangent_of(&self, pass: DiffPassId) -> Self
Create a tangent input key derived from this key.
pass is a unique identifier for the linearize call.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".