pub struct DenseStorage<T = f64> { /* private fields */ }Expand description
Pure-data half of the dense tensor split.
Holds a 64-byte-aligned flat buffer with Arc-based shared
ownership (Copy-on-Write via Arc::make_mut). Shape and memory
order are not carried here — they live on
DenseLayout. For the full
storage + layout bundle, use
DenseTensorData<T>.
§Type Parameters
T- Element type (default: f64)
Implementations§
Source§impl<T> DenseStorage<T>
impl<T> DenseStorage<T>
Sourcepub fn new(data: Vec<T>) -> Self
pub fn new(data: Vec<T>) -> Self
Construct from a Vec<T>, internally rebuilding into a
64-byte-aligned buffer.
Sourcepub fn data_mut(&mut self) -> &mut [T]where
T: Clone,
pub fn data_mut(&mut self) -> &mut [T]where
T: Clone,
Get a mutable reference to the underlying data (triggers CoW if shared).
Sourcepub fn as_mut_ptr(&mut self) -> *mut Twhere
T: Clone,
pub fn as_mut_ptr(&mut self) -> *mut Twhere
T: Clone,
Get mutable pointer to the underlying data for FFI (triggers CoW if shared).
Trait Implementations§
Source§impl<T> Clone for DenseStorage<T>
impl<T> Clone for DenseStorage<T>
impl<T: Scalar> OpsFor<DenseStorage<T>> for NativeBackend
Source§impl<T> Storage for DenseStorage<T>
impl<T> Storage for DenseStorage<T>
impl<T> StorageFor<DenseLayout> for DenseStorage<T>
Auto Trait Implementations§
impl<T> Freeze for DenseStorage<T>
impl<T> RefUnwindSafe for DenseStorage<T>where
T: RefUnwindSafe,
impl<T> Send for DenseStorage<T>
impl<T> Sync for DenseStorage<T>
impl<T> Unpin for DenseStorage<T>
impl<T> UnsafeUnpin for DenseStorage<T>
impl<T> UnwindSafe for DenseStorage<T>where
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> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
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