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<Self>
pub fn compile( operand_dims: &[usize], operand_strides: &[isize], dest_strides: &[isize], axes: &[usize], ) -> Result<Self>
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<()>
pub fn execute<T>( &self, dest: &mut RawStridedMut<'_, T>, operand: &RawStridedRef<'_, T>, exec: Exec<'_>, ) -> Result<()>
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<()>
pub fn execute_uninit<T>( &self, dest: &mut RawStridedMut<'_, MaybeUninit<T>>, operand: &RawStridedRef<'_, T>, exec: Exec<'_>, ) -> Result<()>
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.