pub struct DirectConvolution;Expand description
Direct convolution implementation
Implementations§
Source§impl DirectConvolution
impl DirectConvolution
Sourcepub fn conv2d_direct(
input: &[f32],
kernel: &[f32],
output: &mut [f32],
input_dims: &[usize],
kernel_dims: &[usize],
output_dims: &[usize],
stride: (usize, usize),
padding: (usize, usize),
dilation: (usize, usize),
groups: usize,
) -> BackendResult<()>
pub fn conv2d_direct( input: &[f32], kernel: &[f32], output: &mut [f32], input_dims: &[usize], kernel_dims: &[usize], output_dims: &[usize], stride: (usize, usize), padding: (usize, usize), dilation: (usize, usize), groups: usize, ) -> BackendResult<()>
Perform 2D convolution using a direct approach.
Supports dilation and grouped convolution (which also subsumes
depthwise convolution, expressed as groups == in_channels).
Layout conventions (NCHW): input_dims = [N, C_in, H, W],
kernel_dims = [C_out, C_in / groups, kH, kW],
output_dims = [N, C_out, out_H, out_W]. The output spatial size
must satisfy out = (in + 2*pad - dilation*(k-1) - 1) / stride + 1.
Auto Trait Implementations§
impl Freeze for DirectConvolution
impl RefUnwindSafe for DirectConvolution
impl Send for DirectConvolution
impl Sync for DirectConvolution
impl Unpin for DirectConvolution
impl UnsafeUnpin for DirectConvolution
impl UnwindSafe for DirectConvolution
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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