pub struct TrackedTensor<V: Differentiable> { /* private fields */ }Expand description
Value wrapper for reverse-mode AD.
Wraps any Differentiable value and connects it to a Tape
for gradient computation.
Created via Tape::leaf for gradient-tracked values, or
TrackedTensor::new for values that do not require gradients.
§Examples
ⓘ
use chainrules::{Tape, TrackedTensor};
use tenferro_tensor::{MemoryOrder, Tensor};
use tenferro_device::LogicalMemorySpace;
let tape = Tape::<Tensor<f64>>::new();
let a = tape.leaf(Tensor::ones(
&[2, 3],
LogicalMemorySpace::MainMemory,
MemoryOrder::ColumnMajor,
));
assert!(a.requires_grad());Implementations§
Source§impl<V: Differentiable> TrackedTensor<V>
impl<V: Differentiable> TrackedTensor<V>
Auto Trait Implementations§
impl<V> Freeze for TrackedTensor<V>
impl<V> RefUnwindSafe for TrackedTensor<V>
impl<V> Send for TrackedTensor<V>
impl<V> Sync for TrackedTensor<V>
impl<V> Unpin for TrackedTensor<V>
impl<V> UnwindSafe for TrackedTensor<V>
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