Skip to main content

DebugExecutionEnvironment

Struct DebugExecutionEnvironment 

Source
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

Source

pub fn new(device: DeviceType, debug_mode: bool) -> Self

Create a new debug execution environment

§Arguments
  • device - Device type to execute on
  • debug_mode - Whether to enable detailed debugging
§Returns
  • Self - New debug execution environment
Source

pub fn env(&self) -> &ExecutionEnvironment

Get reference to base execution environment

§Returns
  • &ExecutionEnvironment - Reference to underlying execution environment
Source

pub fn env_mut(&mut self) -> &mut ExecutionEnvironment

Get mutable reference to base execution environment

§Returns
  • &mut ExecutionEnvironment - Mutable reference to execution environment
Source

pub fn metrics(&self) -> &ExecutionMetrics

Get execution metrics

§Returns
  • &ExecutionMetrics - Reference to collected execution metrics
Source

pub fn is_debug_mode(&self) -> bool

Check if debug mode is enabled

§Returns
  • bool - True if debug mode is enabled
Source

pub fn set_debug_mode(&mut self, enabled: bool)

Set debug mode

§Arguments
  • enabled - Whether to enable debug mode
Source

pub fn log(&mut self, message: String)

Add entry to execution log

§Arguments
  • message - Log message to add
Source

pub fn get_log(&self) -> &[String]

Get execution log

§Returns
  • &[String] - Reference to execution log entries
Source

pub fn clear_log(&mut self)

Clear execution log

Source

pub fn log_node_start(&mut self, node_idx: NodeIndex, node: &Node)

Log node execution start

§Arguments
  • node_idx - Index of node being executed
  • node - Node information
Source

pub fn log_node_completion(&mut self, node_idx: NodeIndex, duration_ms: f64)

Log node execution completion

§Arguments
  • node_idx - Index of completed node
  • duration_ms - Execution duration in milliseconds
Source

pub fn log_tensor_info(&mut self, node_idx: NodeIndex, tensor: &Tensor)

Log tensor information

§Arguments
  • node_idx - Index of node associated with tensor
  • tensor - Tensor to log information about
Source

pub fn log_operation( &mut self, op_name: &str, input_count: usize, duration_ms: f64, )

Log operation execution

§Arguments
  • op_name - Name of operation
  • input_count - Number of input tensors
  • duration_ms - Operation execution time
Source

pub fn log_error(&mut self, node_idx: NodeIndex, error: &TorshError)

Log error information

§Arguments
  • node_idx - Index of node where error occurred
  • error - Error that occurred
Source

pub fn generate_debug_report(&self) -> String

Generate debug report

§Returns
  • String - Comprehensive debug report
Source

pub fn print_debug_info(&self)

Print debug information to console

Source

pub fn save_debug_report(&self) -> String

Save debug report to string

§Returns
  • String - Complete debug report
Source

pub fn reset(&mut self)

Reset debug state

Source

pub fn execution_summary(&self) -> String

Get summary of execution state

§Returns
  • String - Brief execution state summary

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V