pub struct AutoLayoutOptimizer { /* private fields */ }Expand description
Automatic layout optimization pass for computation graphs
Implementations§
Source§impl AutoLayoutOptimizer
impl AutoLayoutOptimizer
Sourcepub fn register_tensor(&mut self, tensor_id: usize, layout: DataLayout)
pub fn register_tensor(&mut self, tensor_id: usize, layout: DataLayout)
Register a tensor with its initial layout
Sourcepub fn optimize_for_operation<T>(
&mut self,
tensors: &mut [&mut Tensor<T>],
tensor_ids: &[usize],
op_type: OperationType,
device: &Device,
) -> Result<()>
pub fn optimize_for_operation<T>( &mut self, tensors: &mut [&mut Tensor<T>], tensor_ids: &[usize], op_type: OperationType, device: &Device, ) -> Result<()>
Optimize layout for a specific operation
Sourcepub fn get_layout(&self, tensor_id: usize) -> Option<DataLayout>
pub fn get_layout(&self, tensor_id: usize) -> Option<DataLayout>
Get the current layout of a tensor
Sourcepub fn total_cost(&self) -> f32
pub fn total_cost(&self) -> f32
Get the total conversion cost incurred
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AutoLayoutOptimizer
impl RefUnwindSafe for AutoLayoutOptimizer
impl Send for AutoLayoutOptimizer
impl Sync for AutoLayoutOptimizer
impl Unpin for AutoLayoutOptimizer
impl UnsafeUnpin for AutoLayoutOptimizer
impl UnwindSafe for AutoLayoutOptimizer
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