pub struct NamedTensor<B: Backend, D: NamedDims<B>> { /* private fields */ }Expand description
A tensor with named dimensions.
Implementations§
Source§impl<B: Backend, const D: usize, ND> NamedTensor<B, ND>
impl<B: Backend, const D: usize, ND> NamedTensor<B, ND>
Sourcepub fn from_tensor(tensor: Tensor<B, D>) -> Self
pub fn from_tensor(tensor: Tensor<B, D>) -> Self
Create a named tensor from a tensor.
Source§impl<B: Backend, const D: usize, ND> NamedTensor<B, ND>
impl<B: Backend, const D: usize, ND> NamedTensor<B, ND>
Sourcepub fn matmul<NamedDimsRhs, NamedDimsOut>(
self,
rhs: NamedTensor<B, NamedDimsRhs>,
) -> NamedTensor<B, NamedDimsOut>where
NamedDimsRhs: NamedDims<B, Tensor = Tensor<B, D>>,
NamedDimsOut: NamedDims<B, Tensor = Tensor<B, D>>,
Self: Matmul<NamedTensor<B, NamedDimsRhs>, NamedTensor<B, NamedDimsOut>>,
pub fn matmul<NamedDimsRhs, NamedDimsOut>(
self,
rhs: NamedTensor<B, NamedDimsRhs>,
) -> NamedTensor<B, NamedDimsOut>where
NamedDimsRhs: NamedDims<B, Tensor = Tensor<B, D>>,
NamedDimsOut: NamedDims<B, Tensor = Tensor<B, D>>,
Self: Matmul<NamedTensor<B, NamedDimsRhs>, NamedTensor<B, NamedDimsOut>>,
Applies the matrix multiplication operation.
C = AB
§Panics
If the two tensors dont’ have a compatible shape.
Source§impl<B: Backend, const D: usize, ND> NamedTensor<B, ND>
impl<B: Backend, const D: usize, ND> NamedTensor<B, ND>
Sourcepub fn swap_dims<ND2, const D1: usize, const D2: usize>(
self,
) -> NamedTensor<B, ND2>
pub fn swap_dims<ND2, const D1: usize, const D2: usize>( self, ) -> NamedTensor<B, ND2>
Swap two dimensions.
Trait Implementations§
Source§impl<B: Clone + Backend, D: Clone + NamedDims<B>> Clone for NamedTensor<B, D>
impl<B: Clone + Backend, D: Clone + NamedDims<B>> Clone for NamedTensor<B, D>
Source§fn clone(&self) -> NamedTensor<B, D>
fn clone(&self) -> NamedTensor<B, D>
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<B, D> Freeze for NamedTensor<B, D>
impl<B, D> RefUnwindSafe for NamedTensor<B, D>
impl<B, D> Send for NamedTensor<B, D>
impl<B, D> Sync for NamedTensor<B, D>
impl<B, D> Unpin for NamedTensor<B, D>
impl<B, D> UnsafeUnpin for NamedTensor<B, D>
impl<B, D> UnwindSafe for NamedTensor<B, D>
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