pub struct OperationContext {
pub input_sizes: Vec<usize>,
pub output_size: Option<usize>,
pub cache_hit_rate: Option<f64>,
pub metadata: HashMap<String, String>,
}Expand description
Context information for an operation
Fields§
§input_sizes: Vec<usize>Input tensor sizes in bytes
output_size: Option<usize>Output tensor size in bytes
cache_hit_rate: Option<f64>Cache hit rate if available
metadata: HashMap<String, String>Custom metadata
Implementations§
Source§impl OperationContext
impl OperationContext
pub fn new() -> Self
pub fn with_input_size(self, size: usize) -> Self
pub fn with_output_size(self, size: usize) -> Self
pub fn with_cache_hit_rate(self, rate: f64) -> Self
pub fn with_metadata(self, key: String, value: String) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OperationContext
impl RefUnwindSafe for OperationContext
impl Send for OperationContext
impl Sync for OperationContext
impl Unpin 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> 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