pub struct LayoutPlan { /* private fields */ }Expand description
Smart layout converter that minimizes conversions in a computation graph
Implementations§
Source§impl LayoutPlan
impl LayoutPlan
Sourcepub fn optimize(
tensor_layouts: &[(usize, DataLayout)],
operations: &[(OperationType, Vec<usize>, Device)],
optimizer: &LayoutOptimizer,
) -> Self
pub fn optimize( tensor_layouts: &[(usize, DataLayout)], operations: &[(OperationType, Vec<usize>, Device)], optimizer: &LayoutOptimizer, ) -> Self
Create an optimal layout plan for a sequence of operations
Sourcepub fn conversions(&self) -> &[(usize, DataLayout, DataLayout)]
pub fn conversions(&self) -> &[(usize, DataLayout, DataLayout)]
Get the planned conversions
Sourcepub fn optimal_layout(&self, tensor_id: usize) -> Option<DataLayout>
pub fn optimal_layout(&self, tensor_id: usize) -> Option<DataLayout>
Get the optimal layout for a tensor
Auto Trait Implementations§
impl Freeze for LayoutPlan
impl RefUnwindSafe for LayoutPlan
impl Send for LayoutPlan
impl Sync for LayoutPlan
impl Unpin for LayoutPlan
impl UnsafeUnpin for LayoutPlan
impl UnwindSafe for LayoutPlan
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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