pub struct DepthwiseConv2dLayer { /* private fields */ }Expand description
Depthwise 2D convolution layer (NHWC layout).
Each input channel is convolved with its own filter.
Kernel shape: [KH, KW, C, 1].
Implementations§
Source§impl DepthwiseConv2dLayer
impl DepthwiseConv2dLayer
pub fn new( channels: usize, kernel_h: usize, kernel_w: usize, stride_h: usize, stride_w: usize, weight: Tensor, bias: Option<Tensor>, ) -> Result<Self, ModelError>
pub fn zero_init( channels: usize, kernel_h: usize, kernel_w: usize, stride_h: usize, stride_w: usize, use_bias: bool, ) -> Result<Self, ModelError>
pub fn register_params(&mut self, graph: &mut Graph)
pub fn sync_from_graph(&mut self, graph: &Graph) -> Result<(), ModelError>
pub fn channels(&self) -> usize
pub fn kernel_h(&self) -> usize
pub fn kernel_w(&self) -> usize
pub fn stride_h(&self) -> usize
pub fn stride_w(&self) -> usize
pub fn weight(&self) -> &Tensor
pub fn bias(&self) -> Option<&Tensor>
pub fn weight_mut(&mut self) -> &mut Tensor
pub fn bias_mut(&mut self) -> Option<&mut Tensor>
pub fn weight_node(&self) -> Option<NodeId>
pub fn bias_node(&self) -> Option<NodeId>
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 DepthwiseConv2dLayer
impl Clone for DepthwiseConv2dLayer
Source§fn clone(&self) -> DepthwiseConv2dLayer
fn clone(&self) -> DepthwiseConv2dLayer
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 DepthwiseConv2dLayer
impl Debug for DepthwiseConv2dLayer
Source§impl PartialEq for DepthwiseConv2dLayer
impl PartialEq for DepthwiseConv2dLayer
impl StructuralPartialEq for DepthwiseConv2dLayer
Auto Trait Implementations§
impl Freeze for DepthwiseConv2dLayer
impl RefUnwindSafe for DepthwiseConv2dLayer
impl Send for DepthwiseConv2dLayer
impl Sync for DepthwiseConv2dLayer
impl Unpin for DepthwiseConv2dLayer
impl UnsafeUnpin for DepthwiseConv2dLayer
impl UnwindSafe for DepthwiseConv2dLayer
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