pub struct DebugExecutionEnvironment { /* private fields */ }Expand description
Enhanced execution environment with debugging capabilities
Extends the basic execution environment with detailed logging, step-by-step execution, and comprehensive debugging information for development and troubleshooting.
Implementations§
Source§impl DebugExecutionEnvironment
impl DebugExecutionEnvironment
Sourcepub fn new(device: DeviceType, debug_mode: bool) -> Self
pub fn new(device: DeviceType, debug_mode: bool) -> Self
Sourcepub fn env(&self) -> &ExecutionEnvironment
pub fn env(&self) -> &ExecutionEnvironment
Get reference to base execution environment
§Returns
&ExecutionEnvironment- Reference to underlying execution environment
Sourcepub fn env_mut(&mut self) -> &mut ExecutionEnvironment
pub fn env_mut(&mut self) -> &mut ExecutionEnvironment
Get mutable reference to base execution environment
§Returns
&mut ExecutionEnvironment- Mutable reference to execution environment
Sourcepub fn metrics(&self) -> &ExecutionMetrics
pub fn metrics(&self) -> &ExecutionMetrics
Sourcepub fn is_debug_mode(&self) -> bool
pub fn is_debug_mode(&self) -> bool
Sourcepub fn set_debug_mode(&mut self, enabled: bool)
pub fn set_debug_mode(&mut self, enabled: bool)
Sourcepub fn log_node_start(&mut self, node_idx: NodeIndex, node: &Node)
pub fn log_node_start(&mut self, node_idx: NodeIndex, node: &Node)
Sourcepub fn log_node_completion(&mut self, node_idx: NodeIndex, duration_ms: f64)
pub fn log_node_completion(&mut self, node_idx: NodeIndex, duration_ms: f64)
Log node execution completion
§Arguments
node_idx- Index of completed nodeduration_ms- Execution duration in milliseconds
Sourcepub fn log_tensor_info(&mut self, node_idx: NodeIndex, tensor: &Tensor)
pub fn log_tensor_info(&mut self, node_idx: NodeIndex, tensor: &Tensor)
Log tensor information
§Arguments
node_idx- Index of node associated with tensortensor- Tensor to log information about
Sourcepub fn log_operation(
&mut self,
op_name: &str,
input_count: usize,
duration_ms: f64,
)
pub fn log_operation( &mut self, op_name: &str, input_count: usize, duration_ms: f64, )
Log operation execution
§Arguments
op_name- Name of operationinput_count- Number of input tensorsduration_ms- Operation execution time
Sourcepub fn log_error(&mut self, node_idx: NodeIndex, error: &TorshError)
pub fn log_error(&mut self, node_idx: NodeIndex, error: &TorshError)
Log error information
§Arguments
node_idx- Index of node where error occurrederror- Error that occurred
Sourcepub fn generate_debug_report(&self) -> String
pub fn generate_debug_report(&self) -> String
Sourcepub fn print_debug_info(&self)
pub fn print_debug_info(&self)
Print debug information to console
Sourcepub fn save_debug_report(&self) -> String
pub fn save_debug_report(&self) -> String
Sourcepub fn execution_summary(&self) -> String
pub fn execution_summary(&self) -> String
Auto Trait Implementations§
impl Freeze for DebugExecutionEnvironment
impl RefUnwindSafe for DebugExecutionEnvironment
impl Send for DebugExecutionEnvironment
impl Sync for DebugExecutionEnvironment
impl Unpin for DebugExecutionEnvironment
impl UnsafeUnpin for DebugExecutionEnvironment
impl UnwindSafe for DebugExecutionEnvironment
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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