A repo to learn using Pytorch C++ API, for Deep Learning programs.
APACHE-2.0 License
A simple repo to learn using Pytorch C++ API, for Deep Learning programs.
Note: This is just a repo, for quick references to setup cmake
, use libtorch and how to
build amazing ML models using Pytorch. The code shouldn't be used in production, or anything serious.
This project uses CMake
of minimum 3.14
for dependency management. You need to ensure that you have cmake
and GCC runtime
installed on your system.
Here's how to install the dependencies, and get started.
mkdir build
cd build
cmake ..
and then cmake --build . --config Release
Here are the steps to run the executables, once compiled!
cd build/src/<the-subproject-you-want-to-run>
# Example: To run the `regression` example
cd build/src/regression
./<executable-file>
# Example: To run the `regression` example
./regression # Can change based on the name of executable
.\<executable-file>.exe
# Example: To run the `regression` example
.\regression.exe # Can change based on the name of executable
Contributions, issues and feature requests are welcome. After cloning & setting up project locally, you can just submit a PR to this repo and it will be deployed once it's accepted.
Its good to have descriptive commit messages, or PR titles so that other contributors can understand about your commit or the PR Created. Read conventional commits before making the commit message.
To add a new section / topic, Get started by making a new folder, inside the src/
folder.
Then, in the main CMakeLists.txt
, Add add_subdirectory("src/<project>")
with <project>
being the
project folder name. Add the project folder name to add_dependencies(src
in the list.
Then, Make the files, and Add a configuration for it, in CMakeLists.txt
in the specific folder you
made for project. Test if it works. Check the commands above and test and make it. And once it works,
You're ready to contribute!
We love people's support in growing and improving. Be sure to leave a if you like the project and also be sure to contribute, if you're interested!