pub struct StridedMapMut<'a, T>where
T: Copy + TypeCommon,{ /* private fields */ }
Expand description
A non
SIMD-optimized mutable mapped strided iterator over tensor elements.
This struct provides mutable access to tensor elements,
Implementations§
Source§impl<'a, T> StridedMapMut<'a, T>
impl<'a, T> StridedMapMut<'a, T>
Sourcepub fn new<U: TensorInfo<T>>(res_tensor: U) -> Self
pub fn new<U: TensorInfo<T>>(res_tensor: U) -> Self
Sourcepub fn zip<C>(self, other: C) -> StridedZip<'a, Self, C>
pub fn zip<C>(self, other: C) -> StridedZip<'a, Self, C>
Combines this StridedMapMut
iterator with another iterator, enabling simultaneous iteration.
This method zips together self
and other
into a StridedZip
iterator, allowing for synchronized
iteration over both iterators. This is particularly useful for operations that require processing
elements from two tensors in parallel, such as element-wise arithmetic operations.
§Arguments
other
- The other iterator to zip with. It must implement theIterGetSet
trait, and its associatedItem
type must beSend
.
§Returns
A StridedZip
instance that encapsulates both self
and other
, allowing for synchronized
iteration over their elements.
Trait Implementations§
Source§impl<'a, T: 'a + CommonBounds> IterGetSet for StridedMapMut<'a, T>
impl<'a, T: 'a + CommonBounds> IterGetSet for StridedMapMut<'a, T>
Source§fn set_end_index(&mut self, _: usize)
fn set_end_index(&mut self, _: usize)
set the end index of the iterator, this is used when rayon perform data splitting
Source§fn set_intervals(&mut self, _: Arc<Vec<(usize, usize)>>)
fn set_intervals(&mut self, _: Arc<Vec<(usize, usize)>>)
set the chunk intervals of the iterator, we chunk the outer loop
Source§fn set_strides(&mut self, strides: Strides)
fn set_strides(&mut self, strides: Strides)
set the strides for the iterator, we call this method normally when we do broadcasting
Source§fn set_shape(&mut self, shape: Shape)
fn set_shape(&mut self, shape: Shape)
set the shape for the iterator, we call this method normally when we do broadcasting
Source§fn broadcast_set_strides(&mut self, shape: &Shape)
fn broadcast_set_strides(&mut self, shape: &Shape)
set the strides for all the iterators
Source§fn outer_loop_size(&self) -> usize
fn outer_loop_size(&self) -> usize
get the outer loop size
Source§fn inner_loop_size(&self) -> usize
fn inner_loop_size(&self) -> usize
get the inner loop size
Source§fn inner_loop_next(&mut self, index: usize) -> Self::Item
fn inner_loop_next(&mut self, index: usize) -> Self::Item
get the next element of the inner loop
Source§impl<'a, T> StridedIterator for StridedMapMut<'a, T>where
T: 'a + CommonBounds,
impl<'a, T> StridedIterator for StridedMapMut<'a, T>where
T: 'a + CommonBounds,
Auto Trait Implementations§
impl<'a, T> Freeze for StridedMapMut<'a, T>
impl<'a, T> RefUnwindSafe for StridedMapMut<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for StridedMapMut<'a, T>
impl<'a, T> Sync for StridedMapMut<'a, T>
impl<'a, T> Unpin for StridedMapMut<'a, T>
impl<'a, T> UnwindSafe for StridedMapMut<'a, T>where
T: RefUnwindSafe,
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
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