pub struct Tensor1D { /* private fields */ }Expand description
Owned 1D tensor with aligned memory.
Implementations§
Source§impl Tensor1D
impl Tensor1D
Sourcepub fn from_vec(v: Vec<f32>) -> Self
pub fn from_vec(v: Vec<f32>) -> Self
Create from an existing Vec<f32> (may copy if not aligned).
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn as_ptr(&self) -> *const f32
pub fn as_mut_ptr(&mut self) -> *mut f32
pub fn as_slice(&self) -> &[f32]
pub fn as_mut_slice(&mut self) -> &mut [f32]
Sourcepub fn copy_from_slice(&mut self, slice: &[f32])
pub fn copy_from_slice(&mut self, slice: &[f32])
Copy from slice.
Trait Implementations§
impl Send for Tensor1D
impl Sync for Tensor1D
Auto Trait Implementations§
impl Freeze for Tensor1D
impl RefUnwindSafe for Tensor1D
impl Unpin for Tensor1D
impl UnwindSafe for Tensor1D
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