Hi,
I’m interested in combining python code with cpp code.
I read about custom cpp extension, extending torchscript, and c++ frontend.
I would like to create a class written in cpp and use it from python code. The cpp class must be able to access tensor objects and methods (as done in https://pytorch.org/tutorials/advanced/cpp_extension.html), while still being used as done in (https://pytorch.org/tutorials/advanced/torch_script_custom_classes.html).
The first link I added shows how to create methods in c++ that access torch classes and methods and the code is compiled using setup.py script, the second link shows how to use a class in c++ that does not use torch classes and methods (the example is a stack class) and is it compiled using cmake.
Is it possible to sort of combine the two? I want to create a class in cpp and be able to access torch classes and methods, then load the class and use it from python code.
Thanks,
Alex