Expand description
A 1d [Tensor] with shape (M, ). Backed by data [f32; M]
.
Implementations
sourceimpl<const M: usize> Tensor1D<M, OwnsTape>
impl<const M: usize> Tensor1D<M, OwnsTape>
sourcepub fn backward(self) -> Gradients
pub fn backward(self) -> Gradients
Calls backward() on self
sourceimpl<const M: usize, H: Tape> Tensor1D<M, H>
impl<const M: usize, H: Tape> Tensor1D<M, H>
sourcepub fn gather_last_dim(
self,
indices: &usize
) -> <Self as Tensor>::LastDimReduced
pub fn gather_last_dim(
self,
indices: &usize
) -> <Self as Tensor>::LastDimReduced
Calls gather_last_dim() on self
.
sourceimpl<const M: usize, H: Tape> Tensor1D<M, H>
impl<const M: usize, H: Tape> Tensor1D<M, H>
sourcepub fn value_mask(self, mask: &Tensor1D<M, NoTape>, value: f32) -> Self
pub fn value_mask(self, mask: &Tensor1D<M, NoTape>, value: f32) -> Self
Calls value_mask() on self
sourceimpl<const M: usize, H: Tape> Tensor1D<M, H>
impl<const M: usize, H: Tape> Tensor1D<M, H>
sourcepub fn max_last_dim(self) -> <Self as Tensor>::LastDimReduced
pub fn max_last_dim(self) -> <Self as Tensor>::LastDimReduced
Calls max_last_dim() on self
.
sourceimpl<const M: usize, H: Tape> Tensor1D<M, H>
impl<const M: usize, H: Tape> Tensor1D<M, 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, H: Tape> Tensor1D<M, H>
impl<const M: usize, H: Tape> Tensor1D<M, 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, H> HasArrayData for Tensor1D<M, H>
impl<const M: usize, H> HasArrayData for Tensor1D<M, H>
sourceimpl<const N: usize, const O: usize, H: Tape> Mul<&'_ Tensor2D<N, O, NoTape>> for Tensor1D<N, H>
impl<const N: usize, const O: usize, H: Tape> Mul<&'_ Tensor2D<N, O, NoTape>> for Tensor1D<N, H>
sourceimpl<const M: usize, HIn, HOut> PutTape<HOut> for Tensor1D<M, HIn> where
HIn: Tape,
HOut: Tape,
impl<const M: usize, HIn, HOut> PutTape<HOut> for Tensor1D<M, HIn> where
HIn: Tape,
HOut: Tape,
sourceimpl<const M: usize, H: Tape> Tensor for Tensor1D<M, H>
impl<const M: usize, H: Tape> Tensor for Tensor1D<M, H>
sourceimpl<const M: usize> TensorCreator for Tensor1D<M, NoTape>
impl<const M: usize> TensorCreator for Tensor1D<M, NoTape>
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 from [unique_id()].
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 N: usize, Tape> RefUnwindSafe for Tensor1D<N, Tape> where
Tape: RefUnwindSafe,
impl<const N: usize, Tape> Send for Tensor1D<N, Tape> where
Tape: Send,
impl<const N: usize, Tape> Sync for Tensor1D<N, Tape> where
Tape: Sync,
impl<const N: usize, Tape> Unpin for Tensor1D<N, Tape> where
Tape: Unpin,
impl<const N: usize, Tape> UnwindSafe for Tensor1D<N, 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