[][src]Function autograd::ops::conv2d

pub fn conv2d<T, A, B>(x: A, w: B, pad: usize, stride: usize) -> Tensor<T> where
    T: Float,
    A: AsRef<Tensor<T>>,
    B: AsRef<Tensor<T>>, 

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

This function supports only f32 and f64.