{"id":20511948,"url":"https://github.com/clearhanhui/learnlibtorch","last_synced_at":"2026-03-02T17:05:45.074Z","repository":{"id":44172146,"uuid":"508897799","full_name":"clearhanhui/LearnLibTorch","owner":"clearhanhui","description":"LibTorch 中文教程。","archived":false,"fork":false,"pushed_at":"2024-09-21T12:56:48.000Z","size":337,"stargazers_count":101,"open_issues_count":0,"forks_count":8,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T03:05:10.226Z","etag":null,"topics":["libtorch","pytorch","pytorch-cpp","toturial"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clearhanhui.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-30T01:43:17.000Z","updated_at":"2025-03-22T03:29:44.000Z","dependencies_parsed_at":"2024-11-15T20:38:51.989Z","dependency_job_id":"448ad403-f9f5-46c5-b43a-bbd96f4b2788","html_url":"https://github.com/clearhanhui/LearnLibTorch","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clearhanhui%2FLearnLibTorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clearhanhui%2FLearnLibTorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clearhanhui%2FLearnLibTorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clearhanhui%2FLearnLibTorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clearhanhui","download_url":"https://codeload.github.com/clearhanhui/LearnLibTorch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248138785,"owners_count":21053952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["libtorch","pytorch","pytorch-cpp","toturial"],"created_at":"2024-11-15T20:38:42.280Z","updated_at":"2025-09-25T12:24:03.755Z","avatar_url":"https://github.com/clearhanhui.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"- [LibTorch 教程](#libtorch-教程)\n  - [简介](#简介)\n  - [目录](#目录)\n  - [软件环境](#软件环境)\n\n\n#  LibTorch 教程 \n\n## 简介\n\nLibTorch 是什么呢，简单来讲可以认为它提供了一种 c++ 前端（同理 PyTorch 是一种 python 前端）。在其[设计哲学](https://pytorch.org/cppdocs/frontend.html#philosophy)中提到\n\n\u003e PyTorch’s C++ frontend was designed with the idea that the Python frontend is great, and should be used when possible; but in some settings, performance and portability requirements make the use of the Python interpreter infeasible. \n\n简单来说它可以提供更高的效率，此外由于在部署和拓展上面也可以和 PyTorch 很好的结合。然而网上关于 LibTorch 的中文教程和资料太少了，最近也要用到就好好学习总结下。\n\n本教程每个目录是独立一个 [CMake](https://cmake.org/) 项目，每个项目主要参考内容是 [LibTorch 官方文档](https://pytorch.org/cppdocs/)和网上的一些中英文博客资料。\n\n\n## 目录\n* [0--LibTorch 配置](./chap0/)\n* [1--HelloWorld](./chap1/)\n* [2--张量基础](./chap2/)\n* [3--自动微分](./chap3/)\n* [4--基本模型](./chap4/)\n* [4_2--数据集和数据加载](./chap4_2/)\n* [5--模型实践](./chap5/)\n* [6--TorchScript](./chap6/)\n* [7--PyTorch拓展](./chap7/)\n* [8--自动微分引擎demo](./chap8/)\n  \n\n## 软件环境\n\n必要的软件和详细的环境配置可以参考[chap0](./chap0/)。\n\n\n----------------\n----------------\n\n如有 bug 欢迎 [issue](https://github.com/clearhanhui/LearnLibTorch/issues)，喜欢的话给个免费的 star 。\n\n对在 CV 的应用 LibTorch 感兴趣可以去看 AllentDan 大佬的 LibTorch 系列，我也从中学习到很多。\n* [https://github.com/AllentDan/LibtorchTutorials](https://github.com/AllentDan/LibtorchTutorials)\n* [https://github.com/AllentDan/LibtorchDetection](https://github.com/AllentDan/LibtorchDetection)\n* [https://github.com/AllentDan/LibtorchSegmentation](https://github.com/AllentDan/LibtorchSegmentation)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclearhanhui%2Flearnlibtorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclearhanhui%2Flearnlibtorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclearhanhui%2Flearnlibtorch/lists"}