pub struct PlanStep {
pub index: usize,
pub operation: String,
pub inputs: Vec<String>,
pub output: String,
pub estimated_memory_bytes: usize,
pub estimated_flops: u64,
pub parallelizable: bool,
pub dependency_level: usize,
}Expand description
A single step in an execution plan.
Fields§
§index: usizeStep index (execution order)
operation: StringOperation name/description
inputs: Vec<String>Input tensor names
output: StringOutput tensor name
estimated_memory_bytes: usizeEstimated memory usage in bytes
estimated_flops: u64Estimated FLOPs
parallelizable: boolWhether this step can run in parallel with the previous step
dependency_level: usizeLevel in the dependency graph (0 = no dependencies)
Implementations§
Source§impl PlanStep
impl PlanStep
Sourcepub fn new(
index: usize,
operation: impl Into<String>,
output: impl Into<String>,
) -> Self
pub fn new( index: usize, operation: impl Into<String>, output: impl Into<String>, ) -> Self
Create a new plan step with default values for optional fields.
Sourcepub fn with_inputs(self, inputs: Vec<String>) -> Self
pub fn with_inputs(self, inputs: Vec<String>) -> Self
Set the input tensor names.
Sourcepub fn with_memory(self, bytes: usize) -> Self
pub fn with_memory(self, bytes: usize) -> Self
Set the estimated memory usage in bytes.
Sourcepub fn with_flops(self, flops: u64) -> Self
pub fn with_flops(self, flops: u64) -> Self
Set the estimated FLOPs.
Sourcepub fn with_parallel(self, p: bool) -> Self
pub fn with_parallel(self, p: bool) -> Self
Set whether this step can run in parallel.
Sourcepub fn with_level(self, l: usize) -> Self
pub fn with_level(self, l: usize) -> Self
Set the dependency level.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PlanStep
impl RefUnwindSafe for PlanStep
impl Send for PlanStep
impl Sync for PlanStep
impl Unpin for PlanStep
impl UnsafeUnpin for PlanStep
impl UnwindSafe for PlanStep
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