pub enum TypedTensor {
F64(StridedArray<f64>),
C64(StridedArray<Complex64>),
}Expand description
A type-erased tensor that dispatches over f64 and Complex64 at runtime.
Variants§
F64(StridedArray<f64>)
C64(StridedArray<Complex64>)
Implementations§
Source§impl TypedTensor
impl TypedTensor
Sourcepub fn to_c64(self) -> TypedTensor
pub fn to_c64(self) -> TypedTensor
Promote to Complex64. If already C64, returns self unchanged.
Sourcepub fn try_demote_to_f64(arr: StridedArray<Complex64>) -> TypedTensor
pub fn try_demote_to_f64(arr: StridedArray<Complex64>) -> TypedTensor
Try to demote a Complex64 array to f64 if all imaginary parts are negligible.
Auto Trait Implementations§
impl Freeze for TypedTensor
impl RefUnwindSafe for TypedTensor
impl Send for TypedTensor
impl Sync for TypedTensor
impl Unpin for TypedTensor
impl UnwindSafe for TypedTensor
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<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
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