pub struct DenseTensor {
pub data: Vec<f64>,
pub shape: Vec<usize>,
}Expand description
Dense tensor for input/output
Fields§
§data: Vec<f64>Tensor data in row-major order
shape: Vec<usize>Shape of the tensor
Implementations§
Source§impl DenseTensor
impl DenseTensor
Sourcepub fn linear_index(&self, indices: &[usize]) -> usize
pub fn linear_index(&self, indices: &[usize]) -> usize
Get linear index from multi-index
Sourcepub fn frobenius_norm(&self) -> f64
pub fn frobenius_norm(&self) -> f64
Compute Frobenius norm
Trait Implementations§
Source§impl Clone for DenseTensor
impl Clone for DenseTensor
Source§fn clone(&self) -> DenseTensor
fn clone(&self) -> DenseTensor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DenseTensor
impl RefUnwindSafe for DenseTensor
impl Send for DenseTensor
impl Sync for DenseTensor
impl Unpin for DenseTensor
impl UnwindSafe for DenseTensor
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