pub struct Strided<T> { /* private fields */ }Expand description
A single-threaded strided iterator over tensor elements.
Implementations§
Source§impl<T: CommonBounds> Strided<T>
impl<T: CommonBounds> Strided<T>
Sourcepub fn shape(&self) -> &Shape
pub fn shape(&self) -> &Shape
Retrieves the shape of the tensor.
§Returns
A reference to the Shape struct representing the tensor’s dimensions.
Sourcepub fn strides(&self) -> &Strides
pub fn strides(&self) -> &Strides
Retrieves the strides of the tensor.
§Returns
A reference to the Strides struct representing the tensor’s stride information.
Sourcepub fn new<U: TensorInfo<T>>(tensor: U) -> Self
pub fn new<U: TensorInfo<T>>(tensor: U) -> Self
Trait Implementations§
Source§impl<T: CommonBounds> IterGetSet for Strided<T>
impl<T: CommonBounds> IterGetSet for Strided<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<T: CommonBounds> ShapeManipulator for Strided<T>
impl<T: CommonBounds> ShapeManipulator for Strided<T>
Source§impl<T: CommonBounds> StridedIterator for Strided<T>
impl<T: CommonBounds> StridedIterator for Strided<T>
Source§impl<T> StridedIteratorMap for Strided<T>
impl<T> StridedIteratorMap for Strided<T>
Source§fn map<'a, T, F, U>(self, f: F) -> StridedMap<'a, Self, T, F>
fn map<'a, T, F, U>(self, f: F) -> StridedMap<'a, Self, T, F>
Transforms the strided iterators by applying a provided function to their items. Read more
Source§impl<T> StridedIteratorZip for Strided<T>
impl<T> StridedIteratorZip for Strided<T>
Source§fn zip<'a, C>(self, other: C) -> StridedZip<'a, Self, C>where
C: IterGetSet + ShapeManipulator,
Self: IterGetSet + ShapeManipulator,
<C as IterGetSet>::Item: Send,
<Self as IterGetSet>::Item: Send,
fn zip<'a, C>(self, other: C) -> StridedZip<'a, Self, C>where
C: IterGetSet + ShapeManipulator,
Self: IterGetSet + ShapeManipulator,
<C as IterGetSet>::Item: Send,
<Self as IterGetSet>::Item: Send,
Combines this iterator with another iterator, enabling simultaneous iteration. Read more
Auto Trait Implementations§
impl<T> Freeze for Strided<T>
impl<T> RefUnwindSafe for Strided<T>where
T: RefUnwindSafe,
impl<T> Send for Strided<T>
impl<T> Sync for Strided<T>
impl<T> Unpin for Strided<T>
impl<T> UnwindSafe for Strided<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> 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>
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