- Python Deep Learning
- Ivan Vasilev Daniel Slater Gianmario Spacagna Peter Roelants Valentino Zocca
- 103字
- 2021-07-02 14:31:10
PyTorch
PyTorch (https://pytorch.org/) is a deep learning library based on Torch and developed by Facebook. It is relatively easy to use, and has recently gained a lot of popularity. It will automatically select a GPU, if one is available, reverting to the CPU otherwise. If you wish to select the device explicitly, you could use the following code sample:
# at beginning of the script
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
...
# then whenever you get a new Tensor or Module
# this won't copy if they are already on the desired device
input = data.to(device)
model = MyModule(...).to(device)
推薦閱讀
- Learning Java Functional Programming
- Google Flutter Mobile Development Quick Start Guide
- Java游戲服務(wù)器架構(gòu)實戰(zhàn)
- 基于差分進(jìn)化的優(yōu)化方法及應(yīng)用
- Python王者歸來
- Python高效開發(fā)實戰(zhàn):Django、Tornado、Flask、Twisted(第2版)
- 零基礎(chǔ)學(xué)Python網(wǎng)絡(luò)爬蟲案例實戰(zhàn)全流程詳解(高級進(jìn)階篇)
- CRYENGINE Game Development Blueprints
- Web前端開發(fā)技術(shù):HTML、CSS、JavaScript
- Python High Performance(Second Edition)
- JavaScript+jQuery交互式Web前端開發(fā)(第2版)
- React Router Quick Start Guide
- Nginx Troubleshooting
- Visual FoxPro程序設(shè)計(第二版)
- Selenium自動化測試完全指南:基于Python