pub struct Tensor0D<Tape = NoneTape> { /* private fields */ }
Expand description
A 0d super::Tensor with shape (). Backed by data f32
.
Implementations
sourceimpl Tensor0D<NoneTape>
impl Tensor0D<NoneTape>
sourceimpl<H: Tape> Tensor0D<H>
impl<H: Tape> Tensor0D<H>
sourcepub fn value_mask(self, mask: &Tensor0D<NoneTape>, value: f32) -> Self
pub fn value_mask(self, mask: &Tensor0D<NoneTape>, value: f32) -> Self
Calls value_mask() on self
sourceimpl<H: Tape> Tensor0D<H>
impl<H: Tape> Tensor0D<H>
sourcepub fn normalize<Axes>(self, epsilon: f32) -> Selfwhere
Self: Reduce<Axes>,
<Self as HasArrayType>::Array: HasAxes<Axes>,
pub fn normalize<Axes>(self, epsilon: f32) -> Selfwhere
Self: Reduce<Axes>,
<Self as HasArrayType>::Array: HasAxes<Axes>,
Calls normalize()
sourceimpl<H: Tape> Tensor0D<H>
impl<H: Tape> Tensor0D<H>
sourcepub fn logsumexp<T, Axes>(self) -> Twhere
Self: ReduceTo<T, Axes>,
pub fn logsumexp<T, Axes>(self) -> Twhere
Self: ReduceTo<T, Axes>,
Calls logsumexp() on self
with Axes
.
sourcepub fn log_softmax<Axes>(self) -> Selfwhere
Self: Reduce<Axes>,
pub fn log_softmax<Axes>(self) -> Selfwhere
Self: Reduce<Axes>,
Calls log_softmax() on self
with Axes
Trait Implementations
sourceimpl<TapeL: Tape, TapeR: Tape> Add<Tensor0D<TapeR>> for Tensor0D<TapeL>where
TapeL: Merge<TapeR>,
impl<TapeL: Tape, TapeR: Tape> Add<Tensor0D<TapeR>> for Tensor0D<TapeL>where
TapeL: Merge<TapeR>,
sourceimpl<const M: usize, const N: usize, H: Tape> BroadcastTo<Tensor2D<M, N, H>, AllAxes> for Tensor0D<H>
impl<const M: usize, const N: usize, H: Tape> BroadcastTo<Tensor2D<M, N, H>, AllAxes> for Tensor0D<H>
sourceimpl<const M: usize, const N: usize, const O: usize, H: Tape> BroadcastTo<Tensor3D<M, N, O, H>, AllAxes> for Tensor0D<H>
impl<const M: usize, const N: usize, const O: usize, H: Tape> BroadcastTo<Tensor3D<M, N, O, H>, AllAxes> for Tensor0D<H>
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> BroadcastTo<Tensor4D<M, N, O, P, H>, AllAxes> for Tensor0D<H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> BroadcastTo<Tensor4D<M, N, O, P, H>, AllAxes> for Tensor0D<H>
sourceimpl<TapeL: Tape, TapeR: Tape> Div<Tensor0D<TapeR>> for Tensor0D<TapeL>where
TapeL: Merge<TapeR>,
impl<TapeL: Tape, TapeR: Tape> Div<Tensor0D<TapeR>> for Tensor0D<TapeL>where
TapeL: Merge<TapeR>,
sourceimpl<H> HasArrayData for Tensor0D<H>
impl<H> HasArrayData for Tensor0D<H>
sourceimpl<TapeL: Tape, TapeR: Tape> Mul<Tensor0D<TapeR>> for Tensor0D<TapeL>where
TapeL: Merge<TapeR>,
impl<TapeL: Tape, TapeR: Tape> Mul<Tensor0D<TapeR>> for Tensor0D<TapeL>where
TapeL: Merge<TapeR>,
sourceimpl<const A: usize, H: Tape> Reshape<Tensor0D<H>> for Tensor1D<A, H>where
Assert<{ _ }>: ConstTrue,
impl<const A: usize, H: Tape> Reshape<Tensor0D<H>> for Tensor1D<A, H>where
Assert<{ _ }>: ConstTrue,
sourceimpl<const A: usize, const B: usize, H: Tape> Reshape<Tensor0D<H>> for Tensor2D<A, B, H>where
Assert<{ _ }>: ConstTrue,
impl<const A: usize, const B: usize, H: Tape> Reshape<Tensor0D<H>> for Tensor2D<A, B, H>where
Assert<{ _ }>: ConstTrue,
sourceimpl<const A: usize, const B: usize, const C: usize, H: Tape> Reshape<Tensor0D<H>> for Tensor3D<A, B, C, H>where
Assert<{ _ }>: ConstTrue,
impl<const A: usize, const B: usize, const C: usize, H: Tape> Reshape<Tensor0D<H>> for Tensor3D<A, B, C, H>where
Assert<{ _ }>: ConstTrue,
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 M: usize, H: Tape> Reshape<Tensor1D<M, H>> for Tensor0D<H>where
Assert<{ _ }>: ConstTrue,
impl<const M: usize, H: Tape> Reshape<Tensor1D<M, H>> for Tensor0D<H>where
Assert<{ _ }>: ConstTrue,
sourceimpl<const M: usize, const N: usize, H: Tape> Reshape<Tensor2D<M, N, H>> for Tensor0D<H>where
Assert<{ _ }>: ConstTrue,
impl<const M: usize, const N: usize, H: Tape> Reshape<Tensor2D<M, N, H>> for Tensor0D<H>where
Assert<{ _ }>: ConstTrue,
sourceimpl<const M: usize, const N: usize, const O: usize, H: Tape> Reshape<Tensor3D<M, N, O, H>> for Tensor0D<H>where
Assert<{ _ }>: ConstTrue,
impl<const M: usize, const N: usize, const O: usize, H: Tape> Reshape<Tensor3D<M, N, O, H>> for Tensor0D<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 M: usize, H: Tape> SelectTo<Tensor0D<H>, Axis<0>> for Tensor1D<M, H>
impl<const M: usize, H: Tape> SelectTo<Tensor0D<H>, Axis<0>> for Tensor1D<M, H>
type Indices = usize
sourcefn select(self, indices: &Self::Indices) -> Tensor0D<H>
fn select(self, indices: &Self::Indices) -> Tensor0D<H>
Select sub elements using Self::Indices.
The same element can be selected multiple times depending
on Self::Indices. Read more
sourceimpl<TapeL: Tape, TapeR: Tape> Sub<Tensor0D<TapeR>> for Tensor0D<TapeL>where
TapeL: Merge<TapeR>,
impl<TapeL: Tape, TapeR: Tape> Sub<Tensor0D<TapeR>> for Tensor0D<TapeL>where
TapeL: Merge<TapeR>,
sourceimpl<H: Tape> Tensor for Tensor0D<H>
impl<H: Tape> Tensor for Tensor0D<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.
sourcefn with_empty_tape(&self) -> Self
fn with_empty_tape(&self) -> Self
Clones self and initializes a new empty tape.
sourceimpl TensorCreator for Tensor0D<NoneTape>
impl TensorCreator for Tensor0D<NoneTape>
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.impl<H: Tape> ReduceTo<Tensor0D<H>, AllAxes> for Tensor0D<H>
impl<const M: usize, H: Tape> ReduceTo<Tensor0D<H>, AllAxes> for Tensor1D<M, H>
impl<const M: usize, const N: usize, H: Tape> ReduceTo<Tensor0D<H>, AllAxes> for Tensor2D<M, N, H>
impl<const M: usize, const N: usize, const O: usize, H: Tape> ReduceTo<Tensor0D<H>, AllAxes> for Tensor3D<M, N, O, H>
impl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> ReduceTo<Tensor0D<H>, AllAxes> for Tensor4D<M, N, O, P, H>
Auto Trait Implementations
impl<Tape> RefUnwindSafe for Tensor0D<Tape>where
Tape: RefUnwindSafe,
impl<Tape> Send for Tensor0D<Tape>where
Tape: Send,
impl<Tape> Sync for Tensor0D<Tape>where
Tape: Sync,
impl<Tape> Unpin for Tensor0D<Tape>where
Tape: Unpin,
impl<Tape> UnwindSafe for Tensor0D<Tape>where
Tape: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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 Twhere
T: Tensor<Dtype = f32>,
impl<T> CanUpdateWithGradients for Twhere
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.