pub struct Flatten<D: Dtype, IT, OT> { /* private fields */ }Expand description
Flatten layer: collapses all spatial dimensions into a single feature vector.
Input shape: [N, C, H, W] (rank 4)
Output shape: [N, C * H * W] (rank 2)
Type parameters:
D— element dtypeIT— input tensor type (rank 4:[N, C, H, W])OT— output tensor type (rank 2:[N, C*H*W])
Tensor bounds are on impls, not the struct, so SymTensor can have its
own Layer impl without a coherence conflict.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<D, IT, OT> Freeze for Flatten<D, IT, OT>
impl<D, IT, OT> RefUnwindSafe for Flatten<D, IT, OT>
impl<D, IT, OT> Send for Flatten<D, IT, OT>
impl<D, IT, OT> Sync for Flatten<D, IT, OT>
impl<D, IT, OT> Unpin for Flatten<D, IT, OT>
impl<D, IT, OT> UnsafeUnpin for Flatten<D, IT, OT>
impl<D, IT, OT> UnwindSafe for Flatten<D, IT, OT>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more