pub struct Storage<T>(/* private fields */);Implementations§
Source§impl<T: WithDType> Storage<T>
impl<T: WithDType> Storage<T>
pub fn zeros(shape: &Shape) -> Self
pub fn ones(shape: &Shape) -> Self
pub fn full(value: T, shape: &Shape) -> Self
pub fn new<D: Into<Vec<T>>>(data: D) -> Self
pub fn data(&self) -> &[T]
pub fn data_mut(&mut self) -> &mut [T]
pub fn dtype(&self) -> DType
pub fn copy_data(&self) -> Vec<T>
pub fn get(&self, index: usize) -> Option<T>
pub fn get_unchecked(&self, index: usize) -> T
pub fn set(&mut self, index: usize, value: T) -> Option<()>
pub fn set_unchecked(&mut self, index: usize, value: T)
pub fn len(&self) -> usize
pub fn copy(&self, layout: &Layout) -> Self
pub fn copy_map<F, U>(&self, layout: &Layout, f: F) -> Storage<U>
Source§impl<T: NumDType> Storage<T>
impl<T: NumDType> Storage<T>
pub fn rand_uniform(shape: &Shape, min: T, max: T) -> Result<Self>
Source§impl<F: FloatDType> Storage<F>
impl<F: FloatDType> Storage<F>
pub fn rand_normal(shape: &Shape, mean: F, std: F) -> Result<Self>
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Storage<T>
impl<T> RefUnwindSafe for Storage<T>where
T: RefUnwindSafe,
impl<T> Send for Storage<T>where
T: Send,
impl<T> Sync for Storage<T>where
T: Sync,
impl<T> Unpin for Storage<T>where
T: Unpin,
impl<T> UnsafeUnpin for Storage<T>
impl<T> UnwindSafe for Storage<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