pub struct OperationContext {
pub operation: Option<String>,
pub parameters: HashMap<String, String>,
pub shapes: Vec<Vec<usize>>,
pub dtypes: Vec<String>,
pub memory_info: Option<MemoryInfo>,
pub thread_info: Option<ThreadInfo>,
pub performance_hints: Vec<String>,
pub timestamp: u64,
}Expand description
Operation context for errors
Fields§
§operation: Option<String>The operation being performed
parameters: HashMap<String, String>Input parameters or relevant data
shapes: Vec<Vec<usize>>Array shapes involved in the operation
dtypes: Vec<String>Data types involved
memory_info: Option<MemoryInfo>Memory usage information
thread_info: Option<ThreadInfo>Thread information
performance_hints: Vec<String>Performance hints
timestamp: u64Timestamp when the operation started
Implementations§
Source§impl OperationContext
impl OperationContext
Sourcepub fn with_parameter<K, V>(self, key: K, value: V) -> Self
pub fn with_parameter<K, V>(self, key: K, value: V) -> Self
Add a parameter to the context
Sourcepub fn with_shape(self, shape: Vec<usize>) -> Self
pub fn with_shape(self, shape: Vec<usize>) -> Self
Add array shape information
Sourcepub fn with_shapes(self, shapes: &[Vec<usize>]) -> Self
pub fn with_shapes(self, shapes: &[Vec<usize>]) -> Self
Add array shapes information
Sourcepub fn with_dtype(self, dtype: &str) -> Self
pub fn with_dtype(self, dtype: &str) -> Self
Add data type information
Sourcepub fn with_memory_info(self, memory_info: MemoryInfo) -> Self
pub fn with_memory_info(self, memory_info: MemoryInfo) -> Self
Add memory information
Sourcepub fn with_thread_info(self, thread_info: ThreadInfo) -> Self
pub fn with_thread_info(self, thread_info: ThreadInfo) -> Self
Add thread information
Sourcepub fn with_performance_hint(self, hint: &str) -> Self
pub fn with_performance_hint(self, hint: &str) -> Self
Add a performance hint
Trait Implementations§
Source§impl Clone for OperationContext
impl Clone for OperationContext
Source§fn clone(&self) -> OperationContext
fn clone(&self) -> OperationContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OperationContext
impl Debug for OperationContext
Auto Trait Implementations§
impl Freeze for OperationContext
impl RefUnwindSafe for OperationContext
impl Send for OperationContext
impl Sync for OperationContext
impl Unpin for OperationContext
impl UnsafeUnpin for OperationContext
impl UnwindSafe for OperationContext
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.