pub struct ReversePlan { /* private fields */ }Expand description
A compiled reverse traversal over selected axes.
Replay is a strided copy from a negative-stride source view.
Implementations§
Source§impl ReversePlan
impl ReversePlan
Sourcepub fn compile(
operand_dims: &[usize],
operand_strides: &[isize],
dest_strides: &[isize],
axes: &[usize],
) -> Result<ReversePlan, StridedError>
pub fn compile( operand_dims: &[usize], operand_strides: &[isize], dest_strides: &[isize], axes: &[usize], ) -> Result<ReversePlan, StridedError>
Compile a reverse plan for one operand layout, destination layout, and axis set.
§Errors
Returns StridedError::StrideLengthMismatch when the operand or
destination stride list does not match the operand rank,
StridedError::InvalidAxis when a listed axis is out of range, and
StridedError::NonInjectiveOutputLayout when two destination
elements map onto one offset, or the layout span is not representable.
Returns
StridedError::OffsetOverflow when an element count, a negated
source stride or the source offset delta overflows.
Sourcepub fn execute<T>(
&self,
dest: &mut RawStridedMut<'_, T>,
operand: &RawStridedRef<'_, T>,
exec: Exec<'_>,
) -> Result<(), StridedError>
pub fn execute<T>( &self, dest: &mut RawStridedMut<'_, T>, operand: &RawStridedRef<'_, T>, exec: Exec<'_>, ) -> Result<(), StridedError>
Execute the prepared reverse traversal.
§Errors
Returns StridedError::PlanLayoutMismatch when the views do not
carry the compiled operand and destination layouts, and
StridedError::OffsetOverflow when the operand offset plus the
compiled source offset delta overflows.
Sourcepub fn execute_uninit<T>(
&self,
dest: &mut RawStridedMut<'_, MaybeUninit<T>>,
operand: &RawStridedRef<'_, T>,
exec: Exec<'_>,
) -> Result<(), StridedError>
pub fn execute_uninit<T>( &self, dest: &mut RawStridedMut<'_, MaybeUninit<T>>, operand: &RawStridedRef<'_, T>, exec: Exec<'_>, ) -> Result<(), StridedError>
Execute reverse into storage whose reachable destination elements are uninitialized.
§Errors
Returns StridedError::PlanLayoutMismatch when the views do not
carry the compiled operand and destination layouts, and
StridedError::OffsetOverflow when the operand offset plus the
compiled source offset delta overflows.
Trait Implementations§
Source§impl Clone for ReversePlan
impl Clone for ReversePlan
Source§fn clone(&self) -> ReversePlan
fn clone(&self) -> ReversePlan
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ReversePlan
impl RefUnwindSafe for ReversePlan
impl Send for ReversePlan
impl Sync for ReversePlan
impl Unpin for ReversePlan
impl UnsafeUnpin for ReversePlan
impl UnwindSafe for ReversePlan
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
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> ⓘ
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> ⓘ
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