1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use crate::tensor::PaddingMode;
pub trait Convolution where Self: std::marker::Sized {
fn conv2d(&self, filter: &Self,
stride: (usize, usize),
padding: (usize, usize),
dilation: (usize, usize),
padding_mode: PaddingMode
) -> Self;
fn conv2d_grad(&self, filter: &Self,
stride: (usize, usize),
padding: (usize, usize),
dilation: (usize, usize),
padding_mode: PaddingMode,
output_grad: &Self
) -> (Self, Self);
fn conv_gen(&self, filter: &Self,
stride: &[usize],
padding: &[usize],
dilation: &[usize],
padding_mode: PaddingMode
) -> Self;
fn conv_grad_gen(&self, filter: &Self,
stride: &[usize],
padding: &[usize],
dilation: &[usize],
padding_mode: PaddingMode,
output_grad: &Self,
) -> (Self, Self);
}