pub struct TensorComprehension<T: TensorElement> { /* private fields */ }Expand description
Builder for tensor comprehensions
Implementations§
Source§impl<T: TensorElement + Copy> TensorComprehension<T>
impl<T: TensorElement + Copy> TensorComprehension<T>
Sourcepub fn device(self, device: DeviceType) -> Self
pub fn device(self, device: DeviceType) -> Self
Set the device for the tensor
Sourcepub fn from_iter<I>(self, iter: I) -> Selfwhere
I: IntoIterator<Item = T>,
pub fn from_iter<I>(self, iter: I) -> Selfwhere
I: IntoIterator<Item = T>,
Add elements from an iterator
Sourcepub fn from_iter_with_shape<I>(self, iter: I, shape: Vec<usize>) -> Selfwhere
I: IntoIterator<Item = T>,
pub fn from_iter_with_shape<I>(self, iter: I, shape: Vec<usize>) -> Selfwhere
I: IntoIterator<Item = T>,
Add elements with explicit shape
Trait Implementations§
Source§impl<T: TensorElement + Copy> Default for TensorComprehension<T>
impl<T: TensorElement + Copy> Default for TensorComprehension<T>
Auto Trait Implementations§
impl<T> Freeze for TensorComprehension<T>
impl<T> RefUnwindSafe for TensorComprehension<T>where
T: RefUnwindSafe,
impl<T> Send for TensorComprehension<T>
impl<T> Sync for TensorComprehension<T>
impl<T> Unpin for TensorComprehension<T>where
T: Unpin,
impl<T> UnsafeUnpin for TensorComprehension<T>
impl<T> UnwindSafe for TensorComprehension<T>where
T: UnwindSafe,
Blanket Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more