Struct Zip

Source
pub struct Zip<A: Expression, B: Expression> { /* private fields */ }
Expand description

Expression that gives tuples (x, y) of the elements from each expression.

Trait Implementations§

Source§

impl<A: Clone + Expression, B: Clone + Expression> Clone for Zip<A, B>

Source§

fn clone(&self) -> Zip<A, B>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<A: Expression + Debug, B: Expression + Debug> Debug for Zip<A, B>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<S: Shape, R: Shape, A, B> Expression for Zip<A, B>
where A: Expression<Shape = S>, B: Expression<Shape = R>,

Source§

const IS_REPEATABLE: bool

True if the expression can be restarted from the beginning after the last element.
Source§

type Shape = <<<S as Shape>::Reverse as Shape>::Merge<<R as Shape>::Reverse> as Shape>::Reverse

Array shape type.
Source§

fn shape(&self) -> &Self::Shape

Returns the array shape.
Source§

fn cloned<'a, T: 'a + Clone>(self) -> Cloned<Self>
where Self: Expression<Item = &'a T> + Sized,

Creates an expression which clones all of its elements.
Source§

fn copied<'a, T: 'a + Copy>(self) -> Copied<Self>
where Self: Expression<Item = &'a T> + Sized,

Creates an expression which copies all of its elements.
Source§

fn dim(&self, index: usize) -> usize

Returns the number of elements in the specified dimension. Read more
Source§

fn enumerate(self) -> Enumerate<Self>
where Self: Sized,

Creates an expression which gives tuples of the current count and the element.
Source§

fn eval(self) -> <Self::Shape as Shape>::Owned<Self::Item>
where Self: Sized,

Evaluates the expression into a new array. Read more
Source§

fn eval_into<S: Shape, A: Allocator>( self, tensor: &mut Tensor<Self::Item, S, A>, ) -> &mut Tensor<Self::Item, S, A>
where Self: Sized,

Evaluates the expression with broadcasting and appends to the given array along the first dimension. Read more
Source§

fn fold<T, F: FnMut(T, Self::Item) -> T>(self, init: T, f: F) -> T
where Self: Sized,

Folds all elements into an accumulator by applying an operation, and returns the result.
Source§

fn for_each<F: FnMut(Self::Item)>(self, f: F)
where Self: Sized,

Calls a closure on each element of the expression.
Source§

fn is_empty(&self) -> bool

Returns true if the array contains no elements.
Source§

fn len(&self) -> usize

Returns the number of elements in the array.
Source§

fn map<T, F: FnMut(Self::Item) -> T>(self, f: F) -> Map<Self, F>
where Self: Sized,

Creates an expression that calls a closure on each element.
Source§

fn rank(&self) -> usize

Returns the array rank, i.e. the number of dimensions.
Source§

fn zip<I: IntoExpression>(self, other: I) -> Zip<Self, I::IntoExpr>
where Self: Sized,

Creates an expression that gives tuples (x, y) of the elements from each expression. Read more
Source§

impl<A: Expression, B: Expression> IntoIterator for Zip<A, B>

Source§

type Item = (<A as IntoIterator>::Item, <B as IntoIterator>::Item)

The type of the elements being iterated over.
Source§

type IntoIter = Iter<Zip<A, B>>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<A, B> Freeze for Zip<A, B>
where A: Freeze, B: Freeze, <<<<A as Expression>::Shape as Shape>::Reverse as Shape>::Merge<<<B as Expression>::Shape as Shape>::Reverse> as Shape>::Reverse: Freeze,

§

impl<A, B> RefUnwindSafe for Zip<A, B>

§

impl<A, B> Send for Zip<A, B>
where A: Send, B: Send,

§

impl<A, B> Sync for Zip<A, B>
where A: Sync, B: Sync,

§

impl<A, B> Unpin for Zip<A, B>
where A: Unpin, B: Unpin, <<<<A as Expression>::Shape as Shape>::Reverse as Shape>::Merge<<<B as Expression>::Shape as Shape>::Reverse> as Shape>::Reverse: Unpin,

§

impl<A, B> UnwindSafe for Zip<A, B>
where A: UnwindSafe, B: UnwindSafe, <<<<A as Expression>::Shape as Shape>::Reverse as Shape>::Merge<<<B as Expression>::Shape as Shape>::Reverse> as Shape>::Reverse: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T, E> Apply<T> for E
where E: Expression,

Source§

type Output<F: FnMut(<E as IntoIterator>::Item) -> T> = Map<E, F>

The resulting type after applying a closure.
Source§

type ZippedWith<I: IntoExpression, F: FnMut((<E as IntoIterator>::Item, <I as IntoIterator>::Item)) -> T> = Map<Zip<E, <I as IntoExpression>::IntoExpr>, F>

The resulting type after zipping elements and applying a closure.
Source§

fn apply<F>(self, f: F) -> <E as Apply<T>>::Output<F>
where F: FnMut(<E as IntoIterator>::Item) -> T,

Returns the array or an expression with the given closure applied to each element.
Source§

fn zip_with<I, F>(self, expr: I, f: F) -> <E as Apply<T>>::ZippedWith<I, F>
where I: IntoExpression, F: FnMut((<E as IntoIterator>::Item, <I as IntoIterator>::Item)) -> T,

Returns the array or an expression with the given closure applied to zipped element pairs.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoCloned<T> for T

Source§

fn clone_to(self, target: &mut T)

Moves an existing object or clones from a reference to the target object.
Source§

fn into_cloned(self) -> T

Returns an existing object or a new clone from a reference.
Source§

impl<E> IntoExpression for E
where E: Expression,

Source§

type Shape = <E as Expression>::Shape

Array shape type.
Source§

type IntoExpr = E

Which kind of expression are we turning this into?
Source§

fn into_expr(self) -> E

Creates an expression from a value.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.