Skip to main content

TensorInspector

Struct TensorInspector 

Source
pub struct TensorInspector { /* private fields */ }
Expand description

Tensor inspector for examining intermediate values.

Implementations§

Source§

impl TensorInspector

Source

pub fn new() -> Self

Create a new tensor inspector.

Source

pub fn enable(&mut self)

Enable inspection.

Source

pub fn disable(&mut self)

Disable inspection.

Source

pub fn is_enabled(&self) -> bool

Check if inspection is enabled.

Source

pub fn watch(&mut self, tensor_id: usize)

Add a tensor to the watch list.

Source

pub fn unwatch(&mut self, tensor_id: usize)

Remove a tensor from the watch list.

Source

pub fn clear_watch_list(&mut self)

Clear the watch list.

Source

pub fn should_inspect(&self, tensor_id: usize) -> bool

Check if a tensor should be inspected.

Source

pub fn record_stats(&mut self, stats: TensorStats)

Record tensor statistics.

Source

pub fn get_stats(&self, tensor_id: usize) -> Option<&TensorStats>

Get statistics for a tensor.

Source

pub fn get_all_stats(&self) -> &HashMap<usize, TensorStats>

Get all recorded statistics.

Source

pub fn find_problematic_tensors(&self) -> Vec<&TensorStats>

Find tensors with numerical issues.

Source

pub fn clear(&mut self)

Clear all recorded statistics.

Trait Implementations§

Source§

impl Default for TensorInspector

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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<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, 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