pub struct Tensor0D<TapeHolder = NoTape> { /* private fields */ }
Expand description
A 0d [Tensor] with shape (). Backed by data f32
.
Implementations
sourceimpl<H: TapeHolder> Tensor0D<H>
impl<H: TapeHolder> Tensor0D<H>
sourceimpl<H: TapeHolder> Tensor0D<H>
impl<H: TapeHolder> Tensor0D<H>
sourceimpl<H: TapeHolder> Tensor0D<H>
impl<H: TapeHolder> Tensor0D<H>
sourcepub fn value_mask(self, mask: &Tensor0D<NoTape>, value: f32) -> Self
pub fn value_mask(self, mask: &Tensor0D<NoTape>, value: f32) -> Self
Calls value_mask on self
sourceimpl<H: TapeHolder> Tensor0D<H>
impl<H: TapeHolder> Tensor0D<H>
sourceimpl<H: TapeHolder> Tensor0D<H>
impl<H: TapeHolder> Tensor0D<H>
sourceimpl<H: TapeHolder> Tensor0D<H>
impl<H: TapeHolder> Tensor0D<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<H: TapeHolder> Tensor0D<H>
impl<H: TapeHolder> Tensor0D<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<HIn, HOut> CanPutTapeHolder<HOut> for Tensor0D<HIn> where
HIn: TapeHolder,
HOut: TapeHolder,
impl<HIn, HOut> CanPutTapeHolder<HOut> for Tensor0D<HIn> where
HIn: TapeHolder,
HOut: TapeHolder,
type Output = Tensor0D<HOut>
fn with_tape_holder(self, tape: HOut) -> Self::Output
sourceimpl<H> HasArrayData for Tensor0D<H>
impl<H> HasArrayData for Tensor0D<H>
sourceimpl<H: TapeHolder> Neg for Tensor0D<H>
impl<H: TapeHolder> Neg for Tensor0D<H>
sourceimpl<H: TapeHolder> Tensor for Tensor0D<H>
impl<H: TapeHolder> Tensor for Tensor0D<H>
type TapeHolder = H
type NoTape = Tensor0D<NoTape>
type WithTape = Tensor0D<WithTape>
type LastDimReduced = Tensor0D<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 TensorCreator for Tensor0D<NoTape>
impl TensorCreator for Tensor0D<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<TapeHolder> RefUnwindSafe for Tensor0D<TapeHolder> where
TapeHolder: RefUnwindSafe,
impl<TapeHolder> Send for Tensor0D<TapeHolder> where
TapeHolder: Send,
impl<TapeHolder> Sync for Tensor0D<TapeHolder> where
TapeHolder: Sync,
impl<TapeHolder> Unpin for Tensor0D<TapeHolder> where
TapeHolder: Unpin,
impl<TapeHolder> UnwindSafe for Tensor0D<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