Was the source code for F.conv2d() implemented by Linear transformation?

username: amauhaha
cooked: <p>Hello,</p>
<p>we know that convolution can be regarded as the special case of Linear transformation.<br>
I am not really sure whether the source code for F.conv2d() was implemented by Linear transformation ?</p>
<p>I consider the code (it looks like the source code for F.conv2d())<br>
</p><aside class="onebox githubblob">
  <header class="source">
      <a href="https://github.com/pytorch/pytorch/blob/master/aten/src/ATen/native/Convolution.cpp" target="_blank" rel="nofollow noopener">github.com</a>
  </header>
  <article class="onebox-body">
    <h4><a href="https://github.com/pytorch/pytorch/blob/master/aten/src/ATen/native/Convolution.cpp" target="_blank" rel="nofollow noopener">pytorch/pytorch/blob/master/aten/src/ATen/native/Convolution.cpp</a></h4>
<pre><code class="lang-cpp">#include &lt;limits&gt;
#include &lt;ATen/ATen.h&gt;
#include &lt;ATen/NativeFunctions.h&gt;
#include &lt;ATen/native/cpu/DepthwiseConvKernel.h&gt;
#include &lt;ATen/native/utils/ParamUtils.h&gt;
#include &lt;ATen/native/ConvUtils.h&gt;
#include &lt;ATen/native/xnnpack/Engine.h&gt;

#include &lt;ATen/Config.h&gt;
#include &lt;c10/macros/Macros.h&gt;

#if AT_NNPACK_ENABLED()
#include &lt;nnpack.h&gt;
#endif


constexpr int MIOPEN_DIM_MAX = 5;

namespace at { namespace native {

</code></pre>

  This file has been truncated. <a href="https://github.com/pytorch/pytorch/blob/master/aten/src/ATen/native/Convolution.cpp" target="_blank" rel="nofollow noopener">show original</a>

  </article>
  <div class="onebox-metadata">
    
    
  </div>
  <div style="clear: both"></div>
</aside>
<br>
<aside class="onebox githubblob">
  <header class="source">
      <a href="https://github.com/pytorch/pytorch/blob/e9902358df14dc4809e4f50b12088a5200a1862d/aten/src/ATen/native/ConvolutionMM2d.cpp" target="_blank" rel="nofollow noopener">github.com</a>
  </header>
  <article class="onebox-body">
    <h4><a href="https://github.com/pytorch/pytorch/blob/e9902358df14dc4809e4f50b12088a5200a1862d/aten/src/ATen/native/ConvolutionMM2d.cpp" target="_blank" rel="nofollow noopener">pytorch/pytorch/blob/e9902358df14dc4809e4f50b12088a5200a1862d/aten/src/ATen/native/ConvolutionMM2d.cpp</a></h4>
<pre><code class="lang-cpp">#include &lt;ATen/ATen.h&gt;
#include &lt;ATen/AccumulateType.h&gt;
#include &lt;ATen/Dispatch.h&gt;
#include &lt;ATen/Parallel.h&gt;
#include &lt;ATen/TensorUtils.h&gt;
#include &lt;ATen/core/grad_mode.h&gt;
#include &lt;ATen/div_rtn.h&gt;
#include &lt;ATen/native/Unfold2d.h&gt;

namespace at {
namespace native {

namespace {

static inline void slow_conv2d_shape_check(
    const Tensor&amp; input,
    const Tensor&amp; grad_output,
    const Tensor&amp; weight,
    const Tensor&amp; bias,
    int64_t kernel_height,
</code></pre>

  This file has been truncated. <a href="https://github.com/pytorch/pytorch/blob/e9902358df14dc4809e4f50b12088a5200a1862d/aten/src/ATen/native/ConvolutionMM2d.cpp" target="_blank" rel="nofollow noopener">show original</a>

  </article>
  <div class="onebox-metadata">
    
    
  </div>
  <div style="clear: both"></div>
</aside>

<p>However, I still have no idea about it <img src="https://discuss.pytorch.org/images/emoji/apple/sweat_smile.png?v=9" title=":sweat_smile:" class="emoji" alt=":sweat_smile:"></p>