Can tvm convert a python function to c++ code?

I know that we can define a operator(function) using te in python and tvm can convert it into a c++ source code. But can we convert more common python functions to c++ source code using tvm? For example:

# convert this function into c++ source code
def add(a, b):
    return a + b

And is there any doc related to this topic?

TVM is not designed to be a source to source translator. I would suggest looking at a tool like py2many.

If you wish to compile python to binary, there are other options, look at this question.

There is a project inspired by TVM’s object system that converts a subset of python functions to C++: https://github.com/bytedance/matxscript