pub struct Tensor4D<const M: usize, const N: usize, const O: usize, const P: usize, Tape = NoneTape> { /* private fields */ }
Expand description
A 4d super::Tensor with shape (M, N, O, P). Backed by data [[[[f32; P]; O]; N]; M]
.
Implementations
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize> Tensor4D<M, N, O, P, NoneTape>
impl<const M: usize, const N: usize, const O: usize, const P: usize> Tensor4D<M, N, O, P, NoneTape>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize> Tensor4D<M, N, O, P, OwnedTape>
impl<const M: usize, const N: usize, const O: usize, const P: usize> Tensor4D<M, N, O, P, OwnedTape>
sourcepub fn backward(self) -> Gradients
pub fn backward(self) -> Gradients
Calls backward() on self
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Tensor4D<M, N, O, P, H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Tensor4D<M, N, O, P, H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Tensor4D<M, N, O, P, H>
sourcepub fn value_mask(self, mask: &Tensor4D<M, N, O, P, NoneTape>, value: f32) -> Self
pub fn value_mask(self, mask: &Tensor4D<M, N, O, P, NoneTape>, value: f32) -> Self
Calls value_mask() on self
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Tensor4D<M, N, O, P, H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Tensor4D<M, N, O, P, H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Tensor4D<M, N, O, P, H>
sourcepub fn mean_axis<const I: isize>(self) -> <Self as Reduce1<I>>::Reduced where
Self: Reduce1<I>,
<Self as HasArrayType>::Array: HasAxis<I>,
pub fn mean_axis<const I: isize>(self) -> <Self as Reduce1<I>>::Reduced where
Self: Reduce1<I>,
<Self as HasArrayType>::Array: HasAxis<I>,
Calls mean_axis() on self
.
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Tensor4D<M, N, O, P, H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Tensor4D<M, N, O, P, H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Tensor4D<M, N, O, P, H>
sourcepub fn normalize_axis<const I: isize>(self, epsilon: f32) -> Self where
Self: Reduce1<I>,
<Self as HasArrayType>::Array: HasAxis<I>,
pub fn normalize_axis<const I: isize>(self, epsilon: f32) -> Self where
Self: Reduce1<I>,
<Self as HasArrayType>::Array: HasAxis<I>,
Calls normalize_axis() on self
.
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Tensor4D<M, N, O, P, H>
sourcepub fn logsumexp(self) -> <Self as Reduce1<{ _ }>>::Reduced
pub fn logsumexp(self) -> <Self as Reduce1<{ _ }>>::Reduced
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, const P: usize, H: Tape> Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Tensor4D<M, N, O, P, H>
sourcepub fn std_axis<const I: isize>(
self,
epsilon: f32
) -> <Self as Reduce1<I>>::Reduced where
Self: Reduce1<I>,
<Self as HasArrayType>::Array: HasAxis<I>,
pub fn std_axis<const I: isize>(
self,
epsilon: f32
) -> <Self as Reduce1<I>>::Reduced where
Self: Reduce1<I>,
<Self as HasArrayType>::Array: HasAxis<I>,
Calls std_axis() on self
.
sourcepub fn var_axis<const I: isize>(self) -> <Self as Reduce1<I>>::Reduced where
Self: Reduce1<I>,
<Self as HasArrayType>::Array: HasAxis<I>,
pub fn var_axis<const I: isize>(self) -> <Self as Reduce1<I>>::Reduced where
Self: Reduce1<I>,
<Self as HasArrayType>::Array: HasAxis<I>,
Calls var_axis() on self
.
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Tensor4D<M, N, O, P, H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Tensor4D<M, N, O, P, H>
Trait Implementations
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Add<&Tensor4D<M, N, O, P, NoneTape>> for Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Add<&Tensor4D<M, N, O, P, NoneTape>> for Tensor4D<M, N, O, P, H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Add<Tensor4D<M, N, O, P, H>> for f32
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Add<Tensor4D<M, N, O, P, H>> for f32
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Add<f32> for Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Add<f32> for Tensor4D<M, N, O, P, H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Broadcast1<Tensor4D<M, N, O, P, H>, -1> for Tensor3D<M, N, O, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Broadcast1<Tensor4D<M, N, O, P, H>, -1> for Tensor3D<M, N, O, H>
sourcefn broadcast1(self) -> Tensor4D<M, N, O, P, H>
fn broadcast1(self) -> Tensor4D<M, N, O, P, H>
Broadcast self
into T
, increasing number dimensions by 1.
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Broadcast1<Tensor4D<M, N, O, P, H>, 0> for Tensor3D<N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Broadcast1<Tensor4D<M, N, O, P, H>, 0> for Tensor3D<N, O, P, H>
sourcefn broadcast1(self) -> Tensor4D<M, N, O, P, H>
fn broadcast1(self) -> Tensor4D<M, N, O, P, H>
Broadcast self
into T
, increasing number dimensions by 1.
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Broadcast1<Tensor4D<M, N, O, P, H>, 1> for Tensor3D<M, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Broadcast1<Tensor4D<M, N, O, P, H>, 1> for Tensor3D<M, O, P, H>
sourcefn broadcast1(self) -> Tensor4D<M, N, O, P, H>
fn broadcast1(self) -> Tensor4D<M, N, O, P, H>
Broadcast self
into T
, increasing number dimensions by 1.
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Broadcast1<Tensor4D<M, N, O, P, H>, 2> for Tensor3D<M, N, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Broadcast1<Tensor4D<M, N, O, P, H>, 2> for Tensor3D<M, N, P, H>
sourcefn broadcast1(self) -> Tensor4D<M, N, O, P, H>
fn broadcast1(self) -> Tensor4D<M, N, O, P, H>
Broadcast self
into T
, increasing number dimensions by 1.
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Broadcast2<Tensor4D<M, N, O, P, H>, 0, 1> for Tensor2D<O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Broadcast2<Tensor4D<M, N, O, P, H>, 0, 1> for Tensor2D<O, P, H>
sourcefn broadcast2(self) -> Tensor4D<M, N, O, P, H>
fn broadcast2(self) -> Tensor4D<M, N, O, P, H>
Broadcast self
into T
, increasing number dimensions by 2.
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Broadcast2<Tensor4D<M, N, O, P, H>, 0, 2> for Tensor2D<N, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Broadcast2<Tensor4D<M, N, O, P, H>, 0, 2> for Tensor2D<N, P, H>
sourcefn broadcast2(self) -> Tensor4D<M, N, O, P, H>
fn broadcast2(self) -> Tensor4D<M, N, O, P, H>
Broadcast self
into T
, increasing number dimensions by 2.
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Broadcast2<Tensor4D<M, N, O, P, H>, 0, 3> for Tensor2D<N, O, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Broadcast2<Tensor4D<M, N, O, P, H>, 0, 3> for Tensor2D<N, O, H>
sourcefn broadcast2(self) -> Tensor4D<M, N, O, P, H>
fn broadcast2(self) -> Tensor4D<M, N, O, P, H>
Broadcast self
into T
, increasing number dimensions by 2.
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Broadcast2<Tensor4D<M, N, O, P, H>, 1, 2> for Tensor2D<M, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Broadcast2<Tensor4D<M, N, O, P, H>, 1, 2> for Tensor2D<M, P, H>
sourcefn broadcast2(self) -> Tensor4D<M, N, O, P, H>
fn broadcast2(self) -> Tensor4D<M, N, O, P, H>
Broadcast self
into T
, increasing number dimensions by 2.
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Broadcast2<Tensor4D<M, N, O, P, H>, 1, 3> for Tensor2D<M, O, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Broadcast2<Tensor4D<M, N, O, P, H>, 1, 3> for Tensor2D<M, O, H>
sourcefn broadcast2(self) -> Tensor4D<M, N, O, P, H>
fn broadcast2(self) -> Tensor4D<M, N, O, P, H>
Broadcast self
into T
, increasing number dimensions by 2.
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Broadcast2<Tensor4D<M, N, O, P, H>, 2, 3> for Tensor2D<M, N, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Broadcast2<Tensor4D<M, N, O, P, H>, 2, 3> for Tensor2D<M, N, H>
sourcefn broadcast2(self) -> Tensor4D<M, N, O, P, H>
fn broadcast2(self) -> Tensor4D<M, N, O, P, H>
Broadcast self
into T
, increasing number dimensions by 2.
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Broadcast3<Tensor4D<M, N, O, P, H>, 0, 1, 2> for Tensor1D<P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Broadcast3<Tensor4D<M, N, O, P, H>, 0, 1, 2> for Tensor1D<P, H>
sourcefn broadcast3(self) -> Tensor4D<M, N, O, P, H>
fn broadcast3(self) -> Tensor4D<M, N, O, P, H>
Broadcast self
into T
, increasing number dimensions by 3.
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Broadcast3<Tensor4D<M, N, O, P, H>, 0, 1, 3> for Tensor1D<O, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Broadcast3<Tensor4D<M, N, O, P, H>, 0, 1, 3> for Tensor1D<O, H>
sourcefn broadcast3(self) -> Tensor4D<M, N, O, P, H>
fn broadcast3(self) -> Tensor4D<M, N, O, P, H>
Broadcast self
into T
, increasing number dimensions by 3.
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Broadcast3<Tensor4D<M, N, O, P, H>, 0, 2, 3> for Tensor1D<N, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Broadcast3<Tensor4D<M, N, O, P, H>, 0, 2, 3> for Tensor1D<N, H>
sourcefn broadcast3(self) -> Tensor4D<M, N, O, P, H>
fn broadcast3(self) -> Tensor4D<M, N, O, P, H>
Broadcast self
into T
, increasing number dimensions by 3.
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Broadcast3<Tensor4D<M, N, O, P, H>, 1, 2, 3> for Tensor1D<M, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Broadcast3<Tensor4D<M, N, O, P, H>, 1, 2, 3> for Tensor1D<M, H>
sourcefn broadcast3(self) -> Tensor4D<M, N, O, P, H>
fn broadcast3(self) -> Tensor4D<M, N, O, P, H>
Broadcast self
into T
, increasing number dimensions by 3.
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Broadcast4<Tensor4D<M, N, O, P, H>, 0, 1, 2, 3> for Tensor0D<H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Broadcast4<Tensor4D<M, N, O, P, H>, 0, 1, 2, 3> for Tensor0D<H>
sourcefn broadcast4(self) -> Tensor4D<M, N, O, P, H>
fn broadcast4(self) -> Tensor4D<M, N, O, P, H>
Broadcast self
into T
, increasing number dimensions by 4.
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Clone> Clone for Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Clone> Clone for Tensor4D<M, N, O, P, H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, Tape: Debug> Debug for Tensor4D<M, N, O, P, Tape>
impl<const M: usize, const N: usize, const O: usize, const P: usize, Tape: Debug> Debug for Tensor4D<M, N, O, P, Tape>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize> Default for Tensor4D<M, N, O, P, NoneTape>
impl<const M: usize, const N: usize, const O: usize, const P: usize> Default for Tensor4D<M, N, O, P, NoneTape>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Div<&Tensor4D<M, N, O, P, NoneTape>> for Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Div<&Tensor4D<M, N, O, P, NoneTape>> for Tensor4D<M, N, O, P, H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Div<f32> for Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Div<f32> for Tensor4D<M, N, O, P, H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H> HasArrayData for Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H> HasArrayData for Tensor4D<M, N, O, P, H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H> HasArrayType for Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H> HasArrayType for Tensor4D<M, N, O, P, H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H> HasDevice for Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H> HasDevice for Tensor4D<M, N, O, P, H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H> HasUniqueId for Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H> HasUniqueId for Tensor4D<M, N, O, P, H>
sourceimpl<const B1: usize, const B2: usize, const M: usize, const N: usize, const K: usize, H> MatMulTrTyping<Tensor4D<B1, B2, N, K, NoneTape>> for Tensor4D<B1, B2, M, K, H>
impl<const B1: usize, const B2: usize, const M: usize, const N: usize, const K: usize, H> MatMulTrTyping<Tensor4D<B1, B2, N, K, NoneTape>> for Tensor4D<B1, B2, M, K, H>
sourceimpl<const B1: usize, const B2: usize, const M: usize, const N: usize, const K: usize, H> MatMulTyping<Tensor4D<B1, B2, K, N, NoneTape>> for Tensor4D<B1, B2, M, K, H>
impl<const B1: usize, const B2: usize, const M: usize, const N: usize, const K: usize, H> MatMulTyping<Tensor4D<B1, B2, K, N, NoneTape>> for Tensor4D<B1, B2, M, K, H>
sourceimpl<TAPE: 'static + Tape, const BATCH_SIZE: usize, const IN_CHAN: usize, const OUT_CHAN: usize, const KERNEL_SIZE: usize, const STRIDE: usize, const PADDING: usize, const IN_HEIGHT: usize, const IN_WIDTH: usize> Module<Tensor4D<BATCH_SIZE, IN_CHAN, IN_HEIGHT, IN_WIDTH, TAPE>> for Conv2D<IN_CHAN, OUT_CHAN, KERNEL_SIZE, STRIDE, PADDING>
impl<TAPE: 'static + Tape, const BATCH_SIZE: usize, const IN_CHAN: usize, const OUT_CHAN: usize, const KERNEL_SIZE: usize, const STRIDE: usize, const PADDING: usize, const IN_HEIGHT: usize, const IN_WIDTH: usize> Module<Tensor4D<BATCH_SIZE, IN_CHAN, IN_HEIGHT, IN_WIDTH, TAPE>> for Conv2D<IN_CHAN, OUT_CHAN, KERNEL_SIZE, STRIDE, PADDING>
type Output = Tensor4D<BATCH_SIZE, OUT_CHAN, { (IN_HEIGHT + 2 * PADDING - KERNEL_SIZE) / STRIDE + 1 }, { (IN_WIDTH + 2 * PADDING - KERNEL_SIZE) / STRIDE + 1 }, TAPE>
type Output = Tensor4D<BATCH_SIZE, OUT_CHAN, { (IN_HEIGHT + 2 * PADDING - KERNEL_SIZE) / STRIDE + 1 }, { (IN_WIDTH + 2 * PADDING - KERNEL_SIZE) / STRIDE + 1 }, TAPE>
The type that this unit produces given Input
.
sourcefn forward(
&self,
x: Tensor4D<BATCH_SIZE, IN_CHAN, IN_HEIGHT, IN_WIDTH, TAPE>
) -> Self::Output
fn forward(
&self,
x: Tensor4D<BATCH_SIZE, IN_CHAN, IN_HEIGHT, IN_WIDTH, TAPE>
) -> Self::Output
Pass an Input
through the unit and produce Self::Output.
Can be implemented for multiple Input
types. Read more
sourcefn forward_mut(&mut self, input: Input) -> Self::Output
fn forward_mut(&mut self, input: Input) -> Self::Output
Pass an Input
through the unit and produce Self::Output.
Can be implemented for multiple Input
types. Read more
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Module<Tensor4D<M, N, O, P, H>> for FlattenImage where
Assert<{ _ }>: ConstTrue,
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Module<Tensor4D<M, N, O, P, H>> for FlattenImage where
Assert<{ _ }>: ConstTrue,
sourcefn forward(&self, input: Tensor4D<M, N, O, P, H>) -> Self::Output
fn forward(&self, input: Tensor4D<M, N, O, P, H>) -> Self::Output
Pass an Input
through the unit and produce Self::Output.
Can be implemented for multiple Input
types. Read more
sourcefn forward_mut(&mut self, input: Input) -> Self::Output
fn forward_mut(&mut self, input: Input) -> Self::Output
Pass an Input
through the unit and produce Self::Output.
Can be implemented for multiple Input
types. Read more
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Mul<&Tensor4D<M, N, O, P, NoneTape>> for Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Mul<&Tensor4D<M, N, O, P, NoneTape>> for Tensor4D<M, N, O, P, H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Mul<Tensor4D<M, N, O, P, H>> for f32
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Mul<Tensor4D<M, N, O, P, H>> for f32
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Mul<f32> for Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Mul<f32> for Tensor4D<M, N, O, P, H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Neg for Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Neg for Tensor4D<M, N, O, P, H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, HIn, HOut> PutTape<HOut> for Tensor4D<M, N, O, P, HIn> where
HIn: Tape,
HOut: Tape,
impl<const M: usize, const N: usize, const O: usize, const P: usize, HIn, HOut> PutTape<HOut> for Tensor4D<M, N, O, P, HIn> where
HIn: Tape,
HOut: Tape,
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H> Randomize<f32> for Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H> Randomize<f32> for Tensor4D<M, N, O, P, H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Reduce1<-1> for Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Reduce1<-1> for Tensor4D<M, N, O, P, H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Reduce1<0> for Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Reduce1<0> for Tensor4D<M, N, O, P, H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Reduce1<1> for Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Reduce1<1> for Tensor4D<M, N, O, P, H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Reduce1<2> for Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Reduce1<2> for Tensor4D<M, N, O, P, H>
sourceimpl<const A: usize, const B: usize, const C: usize, const D: usize, H: Tape> Reshape<Tensor0D<H>> for Tensor4D<A, B, C, D, H> where
Assert<{ _ }>: ConstTrue,
impl<const A: usize, const B: usize, const C: usize, const D: usize, H: Tape> Reshape<Tensor0D<H>> for Tensor4D<A, B, C, D, H> where
Assert<{ _ }>: ConstTrue,
sourceimpl<const A: usize, const B: usize, const C: usize, const D: usize, const M: usize, H: Tape> Reshape<Tensor1D<M, H>> for Tensor4D<A, B, C, D, H> where
Assert<{ _ }>: ConstTrue,
impl<const A: usize, const B: usize, const C: usize, const D: usize, const M: usize, H: Tape> Reshape<Tensor1D<M, H>> for Tensor4D<A, B, C, D, H> where
Assert<{ _ }>: ConstTrue,
sourceimpl<const A: usize, const B: usize, const C: usize, const D: usize, const M: usize, const N: usize, H: Tape> Reshape<Tensor2D<M, N, H>> for Tensor4D<A, B, C, D, H> where
Assert<{ _ }>: ConstTrue,
impl<const A: usize, const B: usize, const C: usize, const D: usize, const M: usize, const N: usize, H: Tape> Reshape<Tensor2D<M, N, H>> for Tensor4D<A, B, C, D, H> where
Assert<{ _ }>: ConstTrue,
sourceimpl<const A: usize, const B: usize, const C: usize, const D: usize, const M: usize, const N: usize, const O: usize, H: Tape> Reshape<Tensor3D<M, N, O, H>> for Tensor4D<A, B, C, D, H> where
Assert<{ _ }>: ConstTrue,
impl<const A: usize, const B: usize, const C: usize, const D: usize, const M: usize, const N: usize, const O: usize, H: Tape> Reshape<Tensor3D<M, N, O, H>> for Tensor4D<A, B, C, D, H> where
Assert<{ _ }>: ConstTrue,
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Reshape<Tensor4D<M, N, O, P, H>> for Tensor0D<H> where
Assert<{ _ }>: ConstTrue,
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Reshape<Tensor4D<M, N, O, P, H>> for Tensor0D<H> where
Assert<{ _ }>: ConstTrue,
sourceimpl<const A: usize, const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Reshape<Tensor4D<M, N, O, P, H>> for Tensor1D<A, H> where
Assert<{ _ }>: ConstTrue,
impl<const A: usize, const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Reshape<Tensor4D<M, N, O, P, H>> for Tensor1D<A, H> where
Assert<{ _ }>: ConstTrue,
sourceimpl<const A: usize, const B: usize, const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Reshape<Tensor4D<M, N, O, P, H>> for Tensor2D<A, B, H> where
Assert<{ _ }>: ConstTrue,
impl<const A: usize, const B: usize, const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Reshape<Tensor4D<M, N, O, P, H>> for Tensor2D<A, B, H> where
Assert<{ _ }>: ConstTrue,
sourceimpl<const A: usize, const B: usize, const C: usize, const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Reshape<Tensor4D<M, N, O, P, H>> for Tensor3D<A, B, C, H> where
Assert<{ _ }>: ConstTrue,
impl<const A: usize, const B: usize, const C: usize, const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Reshape<Tensor4D<M, N, O, P, H>> for Tensor3D<A, B, C, H> where
Assert<{ _ }>: ConstTrue,
sourceimpl<const A: usize, const B: usize, const C: usize, const D: usize, const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Reshape<Tensor4D<M, N, O, P, H>> for Tensor4D<A, B, C, D, H> where
Assert<{ _ }>: ConstTrue,
impl<const A: usize, const B: usize, const C: usize, const D: usize, const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Reshape<Tensor4D<M, N, O, P, H>> for Tensor4D<A, B, C, D, H> where
Assert<{ _ }>: ConstTrue,
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Select1<Tensor3D<M, N, O, H>, -1> for Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Select1<Tensor3D<M, N, O, H>, -1> for Tensor4D<M, N, O, P, H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Select1<Tensor3D<M, N, P, H>, 2> for Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Select1<Tensor3D<M, N, P, H>, 2> for Tensor4D<M, N, O, P, H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Select1<Tensor3D<M, O, P, H>, 1> for Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Select1<Tensor3D<M, O, P, H>, 1> for Tensor4D<M, N, O, P, H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Select1<Tensor3D<N, O, P, H>, 0> for Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Select1<Tensor3D<N, O, P, H>, 0> for Tensor4D<M, N, O, P, H>
type Indices = usize
sourcefn select(self, indices: &Self::Indices) -> Tensor3D<N, O, P, H>
fn select(self, indices: &Self::Indices) -> Tensor3D<N, O, P, H>
Select sub elements using Self::Indices. The same element can be selected multiple times depending on Self::Indices. Read more
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, const Z: usize, H: Tape> Select1<Tensor4D<M, N, O, Z, H>, -1> for Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, const Z: usize, H: Tape> Select1<Tensor4D<M, N, O, Z, H>, -1> for Tensor4D<M, N, O, P, H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, const Z: usize, H: Tape> Select1<Tensor4D<M, N, Z, P, H>, 2> for Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, const Z: usize, H: Tape> Select1<Tensor4D<M, N, Z, P, H>, 2> for Tensor4D<M, N, O, P, H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, const Z: usize, H: Tape> Select1<Tensor4D<M, Z, O, P, H>, 1> for Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, const Z: usize, H: Tape> Select1<Tensor4D<M, Z, O, P, H>, 1> for Tensor4D<M, N, O, P, H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, const Z: usize, H: Tape> Select1<Tensor4D<Z, N, O, P, H>, 0> for Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, const Z: usize, H: Tape> Select1<Tensor4D<Z, N, O, P, H>, 0> for Tensor4D<M, N, O, P, H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Sub<&Tensor4D<M, N, O, P, NoneTape>> for Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Sub<&Tensor4D<M, N, O, P, NoneTape>> for Tensor4D<M, N, O, P, H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Sub<Tensor4D<M, N, O, P, H>> for f32
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Sub<Tensor4D<M, N, O, P, H>> for f32
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Sub<f32> for Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Sub<f32> for Tensor4D<M, N, O, P, H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Tensor for Tensor4D<M, N, O, P, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Tensor for Tensor4D<M, N, O, P, H>
sourcefn split_tape(self) -> (Self::NoTape, Self::Tape)
fn split_tape(self) -> (Self::NoTape, Self::Tape)
Removes whatever Tape this tensor has and returns itself without a tape.
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize> TensorCreator for Tensor4D<M, N, O, P, NoneTape>
impl<const M: usize, const N: usize, const O: usize, const P: usize> TensorCreator for Tensor4D<M, N, O, P, NoneTape>
sourcefn new_boxed(data: Box<Self::Array>) -> Self
fn new_boxed(data: Box<Self::Array>) -> Self
Returns a new object with data
and a new UniqueId.
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, const P: usize, Tape> RefUnwindSafe for Tensor4D<M, N, O, P, Tape> where
Tape: RefUnwindSafe,
impl<const M: usize, const N: usize, const O: usize, const P: usize, Tape = NoneTape> !Send for Tensor4D<M, N, O, P, Tape>
impl<const M: usize, const N: usize, const O: usize, const P: usize, Tape = NoneTape> !Sync for Tensor4D<M, N, O, P, Tape>
impl<const M: usize, const N: usize, const O: usize, const P: usize, Tape> Unpin for Tensor4D<M, N, O, P, Tape> where
Tape: Unpin,
impl<const M: usize, const N: usize, const O: usize, const P: usize, Tape> UnwindSafe for Tensor4D<M, N, O, P, Tape> where
Tape: 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>,
sourcefn update<G>(&mut self, grads: &mut G, unused: &mut UnusedTensors) where
G: GradientProvider,
fn update<G>(&mut self, grads: &mut G, unused: &mut UnusedTensors) where
G: GradientProvider,
Subtracts the gradient for the tensor from HasArrayData::mut_data.