pub struct Variable<T> {
pub tensor: T,
pub requires_grad: bool,
pub id: usize,
}Expand description
A variable in the eager execution graph.
Wraps a tensor and tracks whether gradients should be computed for it.
Fields§
§tensor: TThe tensor data
requires_grad: boolWhether this variable requires gradient computation
id: usizeUnique ID for gradient tracking
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Variable<T>where
T: Freeze,
impl<T> RefUnwindSafe for Variable<T>where
T: RefUnwindSafe,
impl<T> Send for Variable<T>where
T: Send,
impl<T> Sync for Variable<T>where
T: Sync,
impl<T> Unpin for Variable<T>where
T: Unpin,
impl<T> UnwindSafe for Variable<T>where
T: UnwindSafe,
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