Home / Class/ MakeConvOutputShape Class — pytorch Architecture

MakeConvOutputShape Class — pytorch Architecture

Architecture documentation for the MakeConvOutputShape class in ConvUtils.h from the pytorch codebase.

Entity Profile

Source Code

aten/src/ATen/native/quantized/ConvUtils.h lines 21–37

template <>
at::SmallVector<int64_t, 4> MakeConvOutputShape<2>(
    int N, // mini-batch
    int M, // output channels
    const std::array<int64_t, 2>& input_image_shape,
    const std::vector<int64_t>& kernel,
    const at::List<int64_t>& stride,
    const at::List<int64_t>& padding,
    const at::List<int64_t>& dilation) {
  const int H = input_image_shape[0];
  const int W = input_image_shape[1];
  const int64_t Y_H =
      (H + 2 * padding[0] - dilation[0] * (kernel[0] - 1) - 1) / stride[0] + 1;
  const int64_t Y_W =
      (W + 2 * padding[1] - dilation[1] * (kernel[1] - 1) - 1) / stride[1] + 1;
  return {N, M, Y_H, Y_W};
}

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free