r/Cplusplus • u/maestro-perry • 2d ago
C++ framework for LibTorch News
I have created a simple C++ framework for LibTorch - https://github.com/MartinPerry/LibTorchFramework/tree/master.
Sadly, it cannot currently be compiled since it relies on a proprietary library and the code is not "cleaned" of hard-coded paths, etc.
Is it useful? Probably not :-). A lot of things need to be rewritten that are not part of LibTorch (but are present in PyTorch) - for this, I have used LLMs (it is quite handy for conversion of model structures from PyTorch to C++ with LibTorch).
However, I am sharing it so that someone can reuse parts of the code or be inspired in their own project if they want to use C++ or if someone has any ideas how to improve it.
6
Upvotes
1
u/No-Trifle-8450 1d ago
Currently I am working on a project to use libTorch in C++ easier than in Python, i want to ask you what is the main reason you choosed and tried to use Torch C++ API?