Why convolution written in python

When I track op definition code, I didn’t find conv’s definition in cpp code, and I found it in python code.

so, I don’t know why define conv implementation in python code while python’s execution is slow.

Need your help~

Since tvm is a compiler infrastructure, though the convolution is defined using a Python API, it is simply defining the computation. When the operation runs, this computation is compiled to a backend, e.g. LLVM, OpenCL, CUDA. So there isn’t an overhead in inference time by using Python here.

To get an intuition, you can see in this example how we define the vector addition using the tvm Python API, and then compile it to a fast module.

Got it! Thank you very much ~~