Trait ParStridedIteratorZip

Source
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§

Source

fn zip<'a, C>(self, other: C) -> ParStridedZip<'a, Self, C>

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 the IterGetSet, UnindexedProducer, and ParallelIterator traits, and its associated Item type must be Send.
§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.

Implementors§