pub struct MaxPool2D { /* private fields */ }Implementations§
Trait Implementations§
Source§impl<T> Layer<T> for MaxPool2D
impl<T> Layer<T> for MaxPool2D
fn forward(&self, input: &Tensor<T>) -> Result<Tensor<T>, TensorError>
fn parameters(&self) -> Vec<&Tensor<T>>
fn parameters_mut(&mut self) -> Vec<&mut Tensor<T>>
fn set_training(&mut self, _training: bool)
fn clone_box(&self) -> Box<dyn Layer<T>>
Source§fn forward_multi(&self, inputs: &[&Tensor<T>]) -> Result<Tensor<T>, TensorError>
fn forward_multi(&self, inputs: &[&Tensor<T>]) -> Result<Tensor<T>, TensorError>
Forward pass for layers that accept multiple input tensors (e.g. merge/combine
layers). The default implementation only supports the single-input case: it
requires exactly one input and delegates to
Layer::forward, so existing
single-input layer implementations are completely unaffected by this method’s
addition (no breaking change). Layers that genuinely need multiple inputs
should override this method.Source§fn layer_type(&self) -> LayerType
fn layer_type(&self) -> LayerType
Returns the type of this layer for ONNX export and introspection
Source§fn set_weight(&mut self, _weight: Tensor<T>) -> Result<(), TensorError>
fn set_weight(&mut self, _weight: Tensor<T>) -> Result<(), TensorError>
Set weight tensor for layers that support weights
Default implementation returns an error
Auto Trait Implementations§
impl Freeze for MaxPool2D
impl RefUnwindSafe for MaxPool2D
impl Send for MaxPool2D
impl Sync for MaxPool2D
impl Unpin for MaxPool2D
impl UnsafeUnpin for MaxPool2D
impl UnwindSafe for MaxPool2D
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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