Is it possible to build Pytorch cpp extension for Python with Cmake? How can I do it?
I’m trying to use this example https://pytorch.org/cppdocs/installing.html 70 for writing cpp extension for Python https://pytorch.org/tutorials/advanced/cpp_extension.html 64
The problem is Pybind11:
if I don’t include Pybind, but use only Pytorch library, there is an error

third_party/libtorch/include/pybind11/detail/common.h:112:10: fatal error: ‘Python.h’ file not found

If I include pybind using add_subdirectory(third_party/pybind11) everything is compiled, but when I try to import library in python code, there is a strange error

Key already registered with the same priority: VariableHooks