I am trying to follow the Custom C++ and CUDA Operators tutorial on pytorch 2.4. After cloning the github repo and installing the extension, testing works fine. Intellisense, on the other hand shows many errors on the code which i would like to fix, since the next step is to code my own operator and intellisense comes a long way.
Im working on a virtualenv on python 3.11.7 and torch 2.4.0+cu121. I have been able to succesfully include torch/extension.h without any intellisense errors by adding the next paths to the includePath on the c_cpp_properties.json:
- /home/fsoler/.local/pythoninstalls/python3.11.7/include/python3.11
- /home/fsoler/envs/tutorial-cppoperator/lib/python3.11/site-packages/torch/include/torch/csrc/api/include/
- /home/fsoler/envs/tutorial-cppoperator/lib/python3.11/site-packages/torch/include/
Despite torch/extension.h being correctly included, many errors are shown by intellisense
The most prolific errors are:
- incomplete type “at::Tensor” is not allowed
- namespace “torch” has no member “empty”
Thanks in advance!