pub struct Flatten2D;
Expand description
Requires Nightly Flattens 3d tensors to 1d, and 4d tensors to 2d.
Specifically:
ⓘ
let _: Tensor1D<{3 * 5 * 7}> = Flatten2D.forward(Tensor3D::<3, 5, 7>::zeros());
let _: Tensor2D<8, {3 * 5 * 7}> = Flatten2D.forward(Tensor4D::<8, 3, 5, 7>::zeros());
Trait Implementations
sourceimpl CanUpdateWithGradients for Flatten2D
impl CanUpdateWithGradients for Flatten2D
sourcefn update<G: GradientProvider>(&mut self, _: &mut G, _: &mut UnusedTensors)
fn update<G: GradientProvider>(&mut self, _: &mut G, _: &mut UnusedTensors)
Updates self given the GradientProvider. When any parameters that
are NOT present in
G
, then this function should
add the tensor’s UniqueId to UnusedTensors. Read moresourceimpl LoadFromNpz for Flatten2D
impl LoadFromNpz for Flatten2D
sourceimpl<const M: usize, const N: usize, const O: usize, H: Tape> Module<Tensor3D<M, N, O, H>> for Flatten2Dwhere
Assert<{ _ }>: ConstTrue,
impl<const M: usize, const N: usize, const O: usize, H: Tape> Module<Tensor3D<M, N, O, H>> for Flatten2Dwhere
Assert<{ _ }>: ConstTrue,
sourceimpl<const M: usize, const N: usize, const O: usize, const P: usize, H: Tape> Module<Tensor4D<M, N, O, P, H>> for Flatten2Dwhere
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 Flatten2Dwhere
Assert<{ _ }>: ConstTrue,
sourceimpl<T> ModuleMut<T> for Flatten2Dwhere
Self: Module<T>,
impl<T> ModuleMut<T> for Flatten2Dwhere
Self: Module<T>,
sourcefn forward_mut(&mut self, input: T) -> Self::Output
fn forward_mut(&mut self, input: T) -> Self::Output
sourceimpl ResetParams for Flatten2D
impl ResetParams for Flatten2D
impl Copy for Flatten2D
Auto Trait Implementations
impl RefUnwindSafe for Flatten2D
impl Send for Flatten2D
impl Sync for Flatten2D
impl Unpin for Flatten2D
impl UnwindSafe for Flatten2D
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