pub enum TensorInputKey {
User {
id: u64,
},
Tangent {
of: Box<TensorInputKey>,
pass: u64,
},
}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);pub fn tangent_of(&self, pass: u64) -> Self
Trait Implementations§
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 (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 TensorInputKey
impl Debug for TensorInputKey
Source§impl Hash for TensorInputKey
impl Hash for TensorInputKey
Source§impl PartialEq for TensorInputKey
impl PartialEq for TensorInputKey
Source§fn eq(&self, other: &TensorInputKey) -> bool
fn eq(&self, other: &TensorInputKey) -> bool
Tests for
self and other values to be equal, and is used by ==.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
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