pub struct Tensor3D<const M: usize, const N: usize, const O: usize, TapeHolder = NoTape> { /* private fields */ }
Expand description
A 3d [Tensor] with shape (M, N, O). Backed by data [[[f32; O]; N]; M]
.
Implementations
sourceimpl<const M: usize, const N: usize, const O: usize> Tensor3D<M, N, O, NoTape>
impl<const M: usize, const N: usize, const O: usize> Tensor3D<M, N, O, NoTape>
sourceimpl<const M: usize, const N: usize, const O: usize, H: TapeHolder> Tensor3D<M, N, O, H>
impl<const M: usize, const N: usize, const O: usize, H: TapeHolder> Tensor3D<M, N, O, H>
sourcepub fn value_mask(self, mask: &Tensor3D<M, N, O, NoTape>, value: f32) -> Self
pub fn value_mask(self, mask: &Tensor3D<M, N, O, NoTape>, value: f32) -> Self
Calls value_mask on self
sourceimpl<const M: usize, const N: usize, const O: usize, H: TapeHolder> Tensor3D<M, N, O, H>
impl<const M: usize, const N: usize, const O: usize, H: TapeHolder> Tensor3D<M, N, O, H>
sourcepub fn logsumexp(self) -> <Self as Tensor>::LastDimReduced
pub fn logsumexp(self) -> <Self as Tensor>::LastDimReduced
Calls logsumexp on self
.
sourcepub fn log_softmax(self) -> Self
pub fn log_softmax(self) -> Self
Calls log_softmax on self
sourceimpl<const M: usize, const N: usize, const O: usize, H: TapeHolder> Tensor3D<M, N, O, H>
impl<const M: usize, const N: usize, const O: usize, H: TapeHolder> Tensor3D<M, N, O, H>
sourcepub fn sum_last_dim(self) -> <Self as Tensor>::LastDimReduced
pub fn sum_last_dim(self) -> <Self as Tensor>::LastDimReduced
Calls sum_last_dim() on self
.
Trait Implementations
sourceimpl<const M: usize, const N: usize, const O: usize, H: TapeHolder> Add<Tensor3D<M, N, O, H>> for &Tensor3D<M, N, O, NoTape>
impl<const M: usize, const N: usize, const O: usize, H: TapeHolder> Add<Tensor3D<M, N, O, H>> for &Tensor3D<M, N, O, NoTape>
sourceimpl<const M: usize, const N: usize, const O: usize, HIn, HOut> CanPutTapeHolder<HOut> for Tensor3D<M, N, O, HIn> where
HIn: TapeHolder,
HOut: TapeHolder,
impl<const M: usize, const N: usize, const O: usize, HIn, HOut> CanPutTapeHolder<HOut> for Tensor3D<M, N, O, HIn> where
HIn: TapeHolder,
HOut: TapeHolder,
type Output = Tensor3D<M, N, O, HOut>
fn with_tape_holder(self, tape: HOut) -> Self::Output
sourceimpl<const M: usize, const N: usize, const O: usize, TapeHolder: Clone> Clone for Tensor3D<M, N, O, TapeHolder>
impl<const M: usize, const N: usize, const O: usize, TapeHolder: Clone> Clone for Tensor3D<M, N, O, TapeHolder>
sourceimpl<const M: usize, const N: usize, const O: usize, TapeHolder: Debug> Debug for Tensor3D<M, N, O, TapeHolder>
impl<const M: usize, const N: usize, const O: usize, TapeHolder: Debug> Debug for Tensor3D<M, N, O, TapeHolder>
sourceimpl<const M: usize, const N: usize, const O: usize, H: TapeHolder> Div<Tensor3D<M, N, O, H>> for &Tensor3D<M, N, O, NoTape>
impl<const M: usize, const N: usize, const O: usize, H: TapeHolder> Div<Tensor3D<M, N, O, H>> for &Tensor3D<M, N, O, NoTape>
sourceimpl<const M: usize, const N: usize, const O: usize, H: TapeHolder> Mul<Tensor3D<M, N, O, H>> for &Tensor3D<M, N, O, NoTape>
impl<const M: usize, const N: usize, const O: usize, H: TapeHolder> Mul<Tensor3D<M, N, O, H>> for &Tensor3D<M, N, O, NoTape>
sourceimpl<const M: usize, const N: usize, const O: usize, H: TapeHolder> Neg for Tensor3D<M, N, O, H>
impl<const M: usize, const N: usize, const O: usize, H: TapeHolder> Neg for Tensor3D<M, N, O, H>
sourceimpl<const M: usize, const N: usize, const O: usize, H> Randomize<f32> for Tensor3D<M, N, O, H>
impl<const M: usize, const N: usize, const O: usize, H> Randomize<f32> for Tensor3D<M, N, O, H>
sourceimpl<const M: usize, const N: usize, const O: usize, H: TapeHolder> Sub<Tensor3D<M, N, O, H>> for &Tensor3D<M, N, O, NoTape>
impl<const M: usize, const N: usize, const O: usize, H: TapeHolder> Sub<Tensor3D<M, N, O, H>> for &Tensor3D<M, N, O, NoTape>
sourceimpl<const M: usize, const N: usize, const O: usize, H: TapeHolder> Tensor for Tensor3D<M, N, O, H>
impl<const M: usize, const N: usize, const O: usize, H: TapeHolder> Tensor for Tensor3D<M, N, O, H>
type TapeHolder = H
type NoTape = Tensor3D<M, N, O, NoTape>
type WithTape = Tensor3D<M, N, O, WithTape>
type LastDimReduced = Tensor2D<M, N, H>
sourcefn split_tape_holder(self) -> (Self::NoTape, Self::TapeHolder)
fn split_tape_holder(self) -> (Self::NoTape, Self::TapeHolder)
Removes whatever TapeHolder this tensor has and returns itself without a tape.
sourceimpl<const M: usize, const N: usize, const O: usize> TensorCreator for Tensor3D<M, N, O, NoTape>
impl<const M: usize, const N: usize, const O: usize> TensorCreator for Tensor3D<M, N, O, NoTape>
sourcefn new(data: Self::Array) -> Self
fn new(data: Self::Array) -> Self
Create a new tensor with Self::Array
on the stack. This just boxes Self::Array
and calls TensorCreator::new_boxed.
sourcefn rand<R: Rng>(rng: &mut R) -> Self where
Standard: Distribution<Self::Dtype>,
fn rand<R: Rng>(rng: &mut R) -> Self where
Standard: Distribution<Self::Dtype>,
Creates a tensor filled with values sampled from Standard distribution.
sourcefn randn<R: Rng>(rng: &mut R) -> Self where
StandardNormal: Distribution<Self::Dtype>,
fn randn<R: Rng>(rng: &mut R) -> Self where
StandardNormal: Distribution<Self::Dtype>,
Creates a tensor filled with values sampled from StandardNormal distribution.
Auto Trait Implementations
impl<const M: usize, const N: usize, const O: usize, TapeHolder> RefUnwindSafe for Tensor3D<M, N, O, TapeHolder> where
TapeHolder: RefUnwindSafe,
impl<const M: usize, const N: usize, const O: usize, TapeHolder> Send for Tensor3D<M, N, O, TapeHolder> where
TapeHolder: Send,
impl<const M: usize, const N: usize, const O: usize, TapeHolder> Sync for Tensor3D<M, N, O, TapeHolder> where
TapeHolder: Sync,
impl<const M: usize, const N: usize, const O: usize, TapeHolder> Unpin for Tensor3D<M, N, O, TapeHolder> where
TapeHolder: Unpin,
impl<const M: usize, const N: usize, const O: usize, TapeHolder> UnwindSafe for Tensor3D<M, N, O, TapeHolder> where
TapeHolder: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CanUpdateWithGradients for T where
T: Tensor<Dtype = f32>,
impl<T> CanUpdateWithGradients for T where
T: Tensor<Dtype = f32>,
fn update<G>(&mut self, grads: &mut G) where
G: GradientProvider,
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more