- 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)
推薦閱讀
- 多媒體CAI課件設計與制作導論(第二版)
- 玩轉Scratch少兒趣味編程
- JavaScript+DHTML語法與范例詳解詞典
- Java入門經典(第6版)
- Learning C++ Functional Programming
- HTML5 移動Web開發從入門到精通(微課精編版)
- Web全棧工程師的自我修養
- Learning Python Design Patterns(Second Edition)
- Python:Master the Art of Design Patterns
- Java EE 7 Performance Tuning and Optimization
- Procedural Content Generation for C++ Game Development
- 計算機應用基礎教程(Windows 7+Office 2010)
- PHP 8從入門到精通(視頻教學版)
- 從零開始學UI:概念解析、實戰提高、突破規則
- Blender 3D Cookbook