pub trait ParStridedIteratorZip: Sized + IterGetSet {
// Provided method
fn zip<'a, C>(self, other: C) -> ParStridedZip<'a, Self, C>
where C: UnindexedProducer + 'a + IterGetSet + ParallelIterator + ShapeManipulator,
<C as IterGetSet>::Item: Send,
Self: UnindexedProducer + ParallelIterator + ShapeManipulator,
<Self as IterGetSet>::Item: Send { ... }
}
Expand description
A trait to zip two parallel iterators together.
Provided Methods§
Sourcefn zip<'a, C>(self, other: C) -> ParStridedZip<'a, Self, C>where
C: UnindexedProducer + 'a + IterGetSet + ParallelIterator + ShapeManipulator,
<C as IterGetSet>::Item: Send,
Self: UnindexedProducer + ParallelIterator + ShapeManipulator,
<Self as IterGetSet>::Item: Send,
fn zip<'a, C>(self, other: C) -> ParStridedZip<'a, Self, C>where
C: UnindexedProducer + 'a + IterGetSet + ParallelIterator + ShapeManipulator,
<C as IterGetSet>::Item: Send,
Self: UnindexedProducer + ParallelIterator + ShapeManipulator,
<Self as IterGetSet>::Item: Send,
Combines this iterator with another iterator, enabling simultaneous parallel iteration.
This method performs shape broadcasting between self
and other
to ensure that both iterators
iterate over tensors with compatible shapes. It adjusts the strides and shapes of both iterators
to match the broadcasted shape and then returns a ParStridedZip
that allows for synchronized
parallel iteration over both iterators.
§Arguments
other
- The other iterator to zip with. It must implement theIterGetSet
,UnindexedProducer
, andParallelIterator
traits, and its associatedItem
type must beSend
.
§Returns
A ParStridedZip
instance that zips together self
and other
, enabling synchronized
parallel iteration over their elements.
§Panics
This method will panic if the shapes of self
and other
cannot be broadcasted together.
Ensure that the shapes are compatible before calling this method.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.