Struct dfdx::nn::modules::AvgPoolGlobal
source · pub struct AvgPoolGlobal;
Expand description
Applies average pooling over an entire image, fully reducing the height and width dimensions:
- Reduces 3d (C, H, W) to 1d (C, )
- Reduces 4d (B, C, H, W) to 2d (B, C)
Pytorch equivalent: torch.nn.AdaptiveAvgPool2d(1)
followed by a flatten.
Examples:
let m: AvgPoolGlobal = Default::default();
let _: Tensor<Rank1<5>, f32, _> = m.forward(dev.zeros::<Rank3<5, 16, 8>>());
let _: Tensor<Rank2<10, 5>, f32, _> = m.forward(dev.zeros::<Rank4<10, 5, 16, 8>>());
Trait Implementations§
source§impl Clone for AvgPoolGlobal
impl Clone for AvgPoolGlobal
source§fn clone(&self) -> AvgPoolGlobal
fn clone(&self) -> AvgPoolGlobal
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Default for AvgPoolGlobal
impl Default for AvgPoolGlobal
source§fn default() -> AvgPoolGlobal
fn default() -> AvgPoolGlobal
Returns the “default value” for a type. Read more