pub struct MixedPrecisionArray<T, D>{ /* private fields */ }
Expand description
Mixed-precision array that can automatically convert between precisions.
This wrapper enables arrays to use different precision levels for storage and computation, automatically converting between precisions as needed.
Implementations§
Source§impl<T, D> MixedPrecisionArray<T, D>
impl<T, D> MixedPrecisionArray<T, D>
Sourcepub fn with_compute_precision(
array: Array<T, D>,
compute_precision: Precision,
) -> Self
pub fn with_compute_precision( array: Array<T, D>, compute_precision: Precision, ) -> Self
Create a new mixed-precision array with specified compute precision.
Sourcepub fn at_precision<U>(&self) -> CoreResult<Array<U, D>>
pub fn at_precision<U>(&self) -> CoreResult<Array<U, D>>
Get the array at the specified precision.
This is a placeholder implementation. In a real implementation, this would convert the array to the requested precision.
Sourcepub fn storage_precision(&self) -> Precision
pub fn storage_precision(&self) -> Precision
Get the current storage precision.
Trait Implementations§
Source§impl<T, D> ArrayProtocol for MixedPrecisionArray<T, D>
Implement ArrayProtocol for MixedPrecisionArray.
impl<T, D> ArrayProtocol for MixedPrecisionArray<T, D>
Implement ArrayProtocol for MixedPrecisionArray.
Source§fn array_function(
&self,
func: &ArrayFunction,
types: &[TypeId],
args: &[Box<dyn Any>],
kwargs: &HashMap<String, Box<dyn Any>>,
) -> Result<Box<dyn Any>, NotImplemented>
fn array_function( &self, func: &ArrayFunction, types: &[TypeId], args: &[Box<dyn Any>], kwargs: &HashMap<String, Box<dyn Any>>, ) -> Result<Box<dyn Any>, NotImplemented>
Implementation of the array protocol. Read more
Source§fn shape(&self) -> &[usize]
fn shape(&self) -> &[usize]
Get the shape of the array (default implementation returns empty slice)
Source§fn box_clone(&self) -> Box<dyn ArrayProtocol>
fn box_clone(&self) -> Box<dyn ArrayProtocol>
Clone this array protocol object.
Source§impl<T, D> Clone for MixedPrecisionArray<T, D>
impl<T, D> Clone for MixedPrecisionArray<T, D>
Source§fn clone(&self) -> MixedPrecisionArray<T, D>
fn clone(&self) -> MixedPrecisionArray<T, D>
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T, D> Debug for MixedPrecisionArray<T, D>
impl<T, D> Debug for MixedPrecisionArray<T, D>
Source§impl<T, D> MixedPrecisionSupport for MixedPrecisionArray<T, D>
Implement MixedPrecisionSupport for MixedPrecisionArray.
impl<T, D> MixedPrecisionSupport for MixedPrecisionArray<T, D>
Implement MixedPrecisionSupport for MixedPrecisionArray.
Source§fn to_precision(
&self,
precision: Precision,
) -> CoreResult<Box<dyn MixedPrecisionSupport>>
fn to_precision( &self, precision: Precision, ) -> CoreResult<Box<dyn MixedPrecisionSupport>>
Convert the array to the specified precision.
Source§fn supports_precision(&self, _precision: Precision) -> bool
fn supports_precision(&self, _precision: Precision) -> bool
Check if the array supports the specified precision.
Auto Trait Implementations§
impl<T, D> Freeze for MixedPrecisionArray<T, D>where
D: Freeze,
impl<T, D> RefUnwindSafe for MixedPrecisionArray<T, D>where
D: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, D> Send for MixedPrecisionArray<T, D>where
T: Send,
impl<T, D> Sync for MixedPrecisionArray<T, D>where
T: Sync,
impl<T, D> Unpin for MixedPrecisionArray<T, D>where
D: Unpin,
impl<T, D> UnwindSafe for MixedPrecisionArray<T, D>where
D: UnwindSafe,
T: RefUnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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