pub struct MemoryCostEstimate {
pub input_bytes: u64,
pub output_bytes: u64,
pub workspace_bytes: u64,
pub peak_bytes: u64,
}Expand description
Memory estimate for a single node.
Named MemoryCostEstimate to avoid collision with
crate::memory::MemoryEstimate.
Fields§
§input_bytes: u64Bytes needed to hold all input tensors.
output_bytes: u64Bytes needed for the output tensor.
workspace_bytes: u64Temporary workspace bytes required during execution.
peak_bytes: u64Peak bytes: input_bytes + output_bytes + workspace_bytes.
Implementations§
Source§impl MemoryCostEstimate
impl MemoryCostEstimate
Sourcepub fn new(input_bytes: u64, output_bytes: u64, workspace_bytes: u64) -> Self
pub fn new(input_bytes: u64, output_bytes: u64, workspace_bytes: u64) -> Self
Create from components; peak_bytes is derived.
Sourcepub fn total_bytes(&self) -> u64
pub fn total_bytes(&self) -> u64
Sum of all byte components.
Sourcepub fn add(&self, other: &MemoryCostEstimate) -> MemoryCostEstimate
pub fn add(&self, other: &MemoryCostEstimate) -> MemoryCostEstimate
Add two estimates together.
Trait Implementations§
Source§impl Clone for MemoryCostEstimate
impl Clone for MemoryCostEstimate
Source§fn clone(&self) -> MemoryCostEstimate
fn clone(&self) -> MemoryCostEstimate
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 MemoryCostEstimate
impl Debug for MemoryCostEstimate
Source§impl PartialEq for MemoryCostEstimate
impl PartialEq for MemoryCostEstimate
impl Eq for MemoryCostEstimate
impl StructuralPartialEq for MemoryCostEstimate
Auto Trait Implementations§
impl Freeze for MemoryCostEstimate
impl RefUnwindSafe for MemoryCostEstimate
impl Send for MemoryCostEstimate
impl Sync for MemoryCostEstimate
impl Unpin for MemoryCostEstimate
impl UnsafeUnpin for MemoryCostEstimate
impl UnwindSafe for MemoryCostEstimate
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 more