pub struct FromFn<S: Shape, F> { /* private fields */ }
Expand description
Expression with a defined shape and elements from the given function.
Trait Implementations§
Source§impl<T, S: Shape, F: FnMut(&[usize]) -> T> Expression for FromFn<S, F>
impl<T, S: Shape, F: FnMut(&[usize]) -> T> Expression for FromFn<S, F>
Source§const IS_REPEATABLE: bool = true
const IS_REPEATABLE: bool = true
True if the expression can be restarted from the beginning after the last element.
Source§fn cloned<'a, T: 'a + Clone>(self) -> Cloned<Self>
fn cloned<'a, T: 'a + Clone>(self) -> Cloned<Self>
Creates an expression which clones all of its elements.
Source§fn copied<'a, T: 'a + Copy>(self) -> Copied<Self>
fn copied<'a, T: 'a + Copy>(self) -> Copied<Self>
Creates an expression which copies all of its elements.
Source§fn dim(&self, index: usize) -> usize
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,
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,
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,
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) -> Twhere
Self: Sized,
fn fold<T, F: FnMut(T, Self::Item) -> T>(self, init: T, f: F) -> Twhere
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,
fn for_each<F: FnMut(Self::Item)>(self, f: F)where
Self: Sized,
Calls a closure on each element of the expression.
Auto Trait Implementations§
impl<S, F> Freeze for FromFn<S, F>
impl<S, F> RefUnwindSafe for FromFn<S, F>
impl<S, F> Send for FromFn<S, F>where
F: Send,
impl<S, F> Sync for FromFn<S, F>where
F: Sync,
impl<S, F> Unpin for FromFn<S, F>
impl<S, F> UnwindSafe for FromFn<S, F>
Blanket Implementations§
Source§impl<T, E> Apply<T> for Ewhere
E: Expression,
impl<T, E> Apply<T> for Ewhere
E: Expression,
Source§type Output<F: FnMut(<E as IntoIterator>::Item) -> T> = Map<E, F>
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>
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>
fn apply<F>(self, f: F) -> <E as Apply<T>>::Output<F>
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>
fn zip_with<I, F>(self, expr: I, f: F) -> <E as Apply<T>>::ZippedWith<I, F>
Returns the array or an expression with the given closure applied to zipped element pairs.
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