阅读量:2
官方文档入口
- 主页与安装页:访问 https://pytorch.org,在导航选择 Docs 进入文档,或直接打开 https://pytorch.org/get-started/locally/ 获取按系统、包管理器和 CUDA 版本生成的一键安装命令。
- 官方文档站点:所有文档统一托管在 https://docs.pytorch.org,包含 API 参考、教程、版本说明 等。
- 源码与版本化文档:GitHub 仓库 https://github.com/pytorch/pytorch 的 docs/ 目录包含文档源码;每个版本都有对应的在线文档(例如 v2.4、v2.5 等),可在 docs.pytorch.org 的版本选择器切换。
Ubuntu用户快速定位
- 在 Get Started Locally 页面依次选择:Linux、Pip 或 Conda、你的 Python 版本、所需的 CUDA 版本(或 CPU),页面会生成可直接复制的命令。
- 若使用 Conda,常见命令示例:
- CPU:conda install pytorch torchvision torchaudio cpuonly -c pytorch
- GPU(指定 CUDA):conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
- 若使用 Pip,常见命令示例:
- CPU:pip3 install torch torchvision torchaudio
- GPU(CUDA 12.1):pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
- 安装完成后可用以下命令验证:
- python -c “import torch; print(torch.version)”
- python -c “import torch; print(torch.cuda.is_available())”
离线查看文档
- 使用 wget 或 curl 下载所需页面或整个站点(示例):
- wget https://docs.pytorch.org/docs/stable/index.html
- 也可克隆仓库后在本地构建:
- git clone https://github.com/pytorch/pytorch
- 参考仓库 README 中的文档构建说明(需 Sphinx 等工具)。
以上就是关于“Ubuntu下PyTorch的官方文档在哪里找”的相关介绍,筋斗云是国内较早的云主机应用的服务商,拥有10余年行业经验,提供丰富的云服务器、租用服务器等相关产品服务。云服务器资源弹性伸缩,主机vCPU、内存性能强悍、超高I/O速度、故障秒级恢复;电子化备案,提交快速,专业团队7×24小时服务支持!
简单好用、高性价比云服务器租用链接:https://www.jindouyun.cn/product/cvm