pub struct DynamicExecutionContext<T: Float + Send + Sync + 'static> { /* private fields */ }Expand description
Dynamic execution context for runtime graph management 実行時グラフ管理のための動的実行コンテキスト
Implementations§
Source§impl<T: Float + Send + Sync + 'static + ScalarOperand + FromPrimitive> DynamicExecutionContext<T>
impl<T: Float + Send + Sync + 'static + ScalarOperand + FromPrimitive> DynamicExecutionContext<T>
Sourcepub fn add_operation(
&mut self,
op: DynamicOp,
input_ids: Vec<usize>,
) -> RusTorchResult<usize>
pub fn add_operation( &mut self, op: DynamicOp, input_ids: Vec<usize>, ) -> RusTorchResult<usize>
Add a dynamic operation node
Sourcepub fn add_leaf(&mut self, tensor: Tensor<T>) -> RusTorchResult<usize>
pub fn add_leaf(&mut self, tensor: Tensor<T>) -> RusTorchResult<usize>
Add a leaf node (input/parameter)
Sourcepub fn get_dynamic_node(&self, id: &usize) -> Option<&Arc<DynamicNode<T>>>
pub fn get_dynamic_node(&self, id: &usize) -> Option<&Arc<DynamicNode<T>>>
Get dynamic node by ID
Sourcepub fn execute(&mut self, output_node_id: usize) -> RusTorchResult<Tensor<T>>
pub fn execute(&mut self, output_node_id: usize) -> RusTorchResult<Tensor<T>>
Execute the graph and return output of specified node
Sourcepub fn execute_node(&self, node: &DynamicNode<T>) -> RusTorchResult<Tensor<T>>
pub fn execute_node(&self, node: &DynamicNode<T>) -> RusTorchResult<Tensor<T>>
Execute a single node
Sourcepub fn get_stats(&self) -> &DynamicExecutionStats
pub fn get_stats(&self) -> &DynamicExecutionStats
Get execution statistics
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear all cached outputs and force recomputation
Sourcepub fn create_execution_plan(
&self,
output_node_id: usize,
) -> RusTorchResult<ExecutionPlan<T>>
pub fn create_execution_plan( &self, output_node_id: usize, ) -> RusTorchResult<ExecutionPlan<T>>
Create execution plan with memory optimization
Auto Trait Implementations§
impl<T> !Freeze for DynamicExecutionContext<T>
impl<T> !RefUnwindSafe for DynamicExecutionContext<T>
impl<T> Send for DynamicExecutionContext<T>
impl<T> Sync for DynamicExecutionContext<T>
impl<T> Unpin for DynamicExecutionContext<T>
impl<T> !UnwindSafe for DynamicExecutionContext<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