pub struct LayoutContext { /* private fields */ }Expand description
Global layout optimization context
Implementations§
Source§impl LayoutContext
impl LayoutContext
Sourcepub fn add_hint(&mut self, hint: LayoutHint)
pub fn add_hint(&mut self, hint: LayoutHint)
Add a layout hint for future operations
Sourcepub fn set_auto_optimize(&mut self, enable: bool)
pub fn set_auto_optimize(&mut self, enable: bool)
Enable or disable automatic layout optimization
Sourcepub fn best_layout(
&self,
tensor_id: usize,
op_type: OperationType,
device: &Device,
) -> DataLayout
pub fn best_layout( &self, tensor_id: usize, op_type: OperationType, device: &Device, ) -> DataLayout
Get the best layout for a tensor considering all hints
Sourcepub fn clear_hints(&mut self)
pub fn clear_hints(&mut self)
Clear all hints
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LayoutContext
impl RefUnwindSafe for LayoutContext
impl Send for LayoutContext
impl Sync for LayoutContext
impl Unpin for LayoutContext
impl UnsafeUnpin for LayoutContext
impl UnwindSafe for LayoutContext
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