pub enum ConvStep<'a> {
GnSilu {
w: &'a [f32],
b: &'a [f32],
},
Conv {
w: &'a [f32],
b: &'a [f32],
out_ch: usize,
in_ch: usize,
k: usize,
stride: usize,
pad: usize,
far: bool,
},
Save,
AddSaved {
via: Option<(&'a [f32], &'a [f32])>,
},
}Expand description
One stage of a convolution chain over an activation [c][h][w].
Variants§
GnSilu
GroupNorm(32) with its affine weights, then SiLU, in place.
Conv
A k×k convolution [out, in, k, k] and its bias. pad: rows and
columns of reflect padding on every side; far: one reflected row
and column on the far side instead (a downsample’s padding).
Fields
Save
Keep the current activation as the residual branch’s input.
AddSaved
Add the kept activation — through a 1×1 convolution (weight, bias) when the branch changes the channel count.
Auto Trait Implementations§
impl<'a> Forget for ConvStep<'a>
impl<'a> Freeze for ConvStep<'a>
impl<'a> Move for ConvStep<'a>
impl<'a> RefUnwindSafe for ConvStep<'a>
impl<'a> Send for ConvStep<'a>
impl<'a> Sync for ConvStep<'a>
impl<'a> Unpin for ConvStep<'a>
impl<'a> UnsafeUnpin for ConvStep<'a>
impl<'a> UnwindSafe for ConvStep<'a>
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