[−][src]Function autograd::ops::conv2d
pub fn conv2d<A, B>(x: A, w: B, pad: usize, stride: usize) -> Tensor<f32> where
A: AsRef<Tensor<f32>>,
B: AsRef<Tensor<f32>>,
2D convolution.
x
: Tensor with shape(batch, channel, h, w)
w
: Tensor with shape(out_channel, channel, filter_h, filter_w)
Returns a tensor with shape (batch, out_channel, out_h, out_w)
where
out_h
=(h + 2 * pad - filter_h) / stride + 1
out_w
=(w + 2 * pad - filter_w) / stride + 1