pub enum TensorInputKey {
User {
id: u64,
},
Tangent {
of: Box<TensorInputKey>,
pass: DiffPassId,
},
}Variants§
Implementations§
Source§impl TensorInputKey
impl TensorInputKey
Sourcepub fn is_tangent(&self) -> bool
pub fn is_tangent(&self) -> bool
Returns true when this key names an AD tangent input.
§Examples
use tenferro_ops::input_key::TensorInputKey;
let key = TensorInputKey::User { id: 0 };
assert!(!key.is_tangent());Sourcepub fn primal_root(&self) -> &Self
pub fn primal_root(&self) -> &Self
Returns the user input key that owns this input’s concrete primal data.
For non-AD keys this returns self; for tangent keys it recursively
follows the of chain to the original user input.
§Examples
use tenferro_ops::input_key::TensorInputKey;
let key = TensorInputKey::User { id: 0 };
assert_eq!(key.primal_root(), &key);Trait Implementations§
Source§impl ADKey for TensorInputKey
Available on crate feature autodiff only.
impl ADKey for TensorInputKey
Available on crate feature
autodiff only.Source§fn 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.Source§impl Clone for TensorInputKey
impl Clone for TensorInputKey
Source§fn clone(&self) -> TensorInputKey
fn clone(&self) -> TensorInputKey
Returns a duplicate of the value. Read more
1.0.0 · 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 TensorInputKey
impl Debug for TensorInputKey
Source§impl Hash for TensorInputKey
impl Hash for TensorInputKey
Source§impl PartialEq for TensorInputKey
impl PartialEq for TensorInputKey
impl Eq for TensorInputKey
impl StructuralPartialEq for TensorInputKey
Auto Trait Implementations§
impl Freeze for TensorInputKey
impl RefUnwindSafe for TensorInputKey
impl Send for TensorInputKey
impl Sync for TensorInputKey
impl Unpin for TensorInputKey
impl UnsafeUnpin for TensorInputKey
impl UnwindSafe for TensorInputKey
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