Trait StridedIteratorZip

Source
pub trait StridedIteratorZip: Sized {
    // Provided method
    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 { ... }
}
Expand description

A trait to zip two iterators together.

Provided Methods§

Source

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

Combines this 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 the IterGetSet trait, and its associated Item type must be Send.
§Returns

A StridedZip instance that encapsulates both self and other, allowing for synchronized

iteration over their elements.

§Panics

This method will panic if the shapes of self and other cannot be broadcasted together.

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§