pub struct DynamicNode<T: Float + Send + Sync + 'static> {
pub op: DynamicOp,
pub inputs: Vec<Arc<DynamicNode<T>>>,
pub cached_output: RwLock<Option<Tensor<T>>>,
pub dirty: RwLock<bool>,
pub id: usize,
pub execution_time: RwLock<Option<Duration>>,
pub memory_usage: RwLock<Option<usize>>,
}Expand description
Dynamic execution node containing operation and runtime information 演算と実行時情報を含む動的実行ノード
Fields§
§op: DynamicOpOperation type
inputs: Vec<Arc<DynamicNode<T>>>Input node references
cached_output: RwLock<Option<Tensor<T>>>Cached output tensor
dirty: RwLock<bool>Whether this node needs recomputation
id: usizeNode ID for tracking
execution_time: RwLock<Option<Duration>>Execution time tracking
memory_usage: RwLock<Option<usize>>Memory usage tracking
Implementations§
Source§impl<T: Float + Send + Sync + 'static> DynamicNode<T>
impl<T: Float + Send + Sync + 'static> DynamicNode<T>
Sourcepub fn new(
op: DynamicOp,
inputs: Vec<Arc<DynamicNode<T>>>,
id: usize,
) -> Arc<Self>
pub fn new( op: DynamicOp, inputs: Vec<Arc<DynamicNode<T>>>, id: usize, ) -> Arc<Self>
Create a new dynamic node
Sourcepub fn mark_dirty(&self)
pub fn mark_dirty(&self)
Mark this node as dirty (needs recomputation)
Sourcepub fn get_cached_output(&self) -> Option<Tensor<T>>
pub fn get_cached_output(&self) -> Option<Tensor<T>>
Get cached output if available
Sourcepub fn set_cached_output(&self, output: Tensor<T>)
pub fn set_cached_output(&self, output: Tensor<T>)
Set cached output
Auto Trait Implementations§
impl<T> !Freeze for DynamicNode<T>
impl<T> RefUnwindSafe for DynamicNode<T>
impl<T> Send for DynamicNode<T>
impl<T> Sync for DynamicNode<T>
impl<T> Unpin for DynamicNode<T>
impl<T> UnwindSafe for DynamicNode<T>
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> 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