I am trying to understand how conv2d is actually invoked, e.g.  the exact code for passing the arguments from Python to C++. I know that the source code for Conv2d is implemented in C++ here:
  
      github.com
  
  
    pytorch/pytorch/blob/master/aten/src/ATen/native/Convolution.cpp 3
#include <ATen/ATen.h>
#include <ATen/Parallel.h>
#include <ATen/native/ConvUtils.h>
#include <ATen/native/Pool.h>
#include <ATen/native/cpu/DepthwiseConvKernel.h>
#include <ATen/native/utils/ParamUtils.h>
#include <ATen/native/xnnpack/Engine.h>
#include <ATen/NativeFunctions.h>
#include <c10/util/accumulate.h>
#include <c10/util/irange.h>

#include <ATen/Config.h>
#include <c10/macros/Macros.h>

#include <limits>

#if AT_NNPACK_ENABLED()
#include <nnpack.h>
#endif



  This file has been truncated. show original

  
  
    
    
  
  


Also, I assume that the torch.nn.functional.conv2d is should be defined somewhere in Python. However, by searching “def conv2d(” doesn’t give me satisfactory results:
(1) torch/nn/quantized/functional.py, which is actually the quantization version of conv2d.
(2) torch/onnx/symbolic_opset9.py doesn’t not seem to be correct either.
(3) torch/onnx/symbolic_caffe2.py seems to be for onnx/caffe.
Can anyone help me find the real definition in Python code for conv2d(not Module/Class, but function), and explains the stack trace for running conv2d, from Python to C++? Much appreciated!