pub struct Tensor { /* private fields */ }Implementations§
Source§impl Tensor
impl Tensor
pub fn new(shape: Vec<usize>, data: Vec<f32>) -> Result<Self, Error>
Sourcepub fn named(
name: &str,
shape: Vec<usize>,
data: Vec<f32>,
) -> Result<Self, Error>
pub fn named( name: &str, shape: Vec<usize>, data: Vec<f32>, ) -> Result<Self, Error>
Like new, but errors name the tensor, for diagnostics on user data.
pub fn shape(&self) -> &[usize]
pub fn data(&self) -> &[f32]
Trait Implementations§
impl StructuralPartialEq for Tensor
Auto Trait Implementations§
impl Freeze for Tensor
impl RefUnwindSafe for Tensor
impl Send for Tensor
impl Sync for Tensor
impl Unpin for Tensor
impl UnsafeUnpin for Tensor
impl UnwindSafe for Tensor
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