pub struct AdaptiveAvgPool2dLayer { /* private fields */ }Expand description
Adaptive average pooling: output a fixed spatial size regardless of input size.
NHWC layout: [batch, H, W, C] -> [batch, out_h, out_w, C].
Implementations§
Source§impl AdaptiveAvgPool2dLayer
impl AdaptiveAvgPool2dLayer
pub fn new(out_h: usize, out_w: usize) -> Self
pub fn output_h(&self) -> usize
pub fn output_w(&self) -> usize
pub fn forward( &self, graph: &mut Graph, input: NodeId, ) -> Result<NodeId, ModelError>
pub fn forward_inference(&self, input: &Tensor) -> Result<Tensor, ModelError>
Trait Implementations§
Source§impl Clone for AdaptiveAvgPool2dLayer
impl Clone for AdaptiveAvgPool2dLayer
Source§fn clone(&self) -> AdaptiveAvgPool2dLayer
fn clone(&self) -> AdaptiveAvgPool2dLayer
Returns a duplicate 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 Debug for AdaptiveAvgPool2dLayer
impl Debug for AdaptiveAvgPool2dLayer
Source§impl PartialEq for AdaptiveAvgPool2dLayer
impl PartialEq for AdaptiveAvgPool2dLayer
impl Copy for AdaptiveAvgPool2dLayer
impl Eq for AdaptiveAvgPool2dLayer
impl StructuralPartialEq for AdaptiveAvgPool2dLayer
Auto Trait Implementations§
impl Freeze for AdaptiveAvgPool2dLayer
impl RefUnwindSafe for AdaptiveAvgPool2dLayer
impl Send for AdaptiveAvgPool2dLayer
impl Sync for AdaptiveAvgPool2dLayer
impl Unpin for AdaptiveAvgPool2dLayer
impl UnsafeUnpin for AdaptiveAvgPool2dLayer
impl UnwindSafe for AdaptiveAvgPool2dLayer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more