- 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)
推薦閱讀
- Python零基礎快樂學習之旅(K12實戰訓練)
- 小程序,巧運營:微信小程序運營招式大全
- JavaScript+Vue+React全程實例
- Arduino家居安全系統構建實戰
- Protocol-Oriented Programming with Swift
- WordPress 4.0 Site Blueprints(Second Edition)
- Python Data Science Cookbook
- Unity 2018 Augmented Reality Projects
- Visual Studio Code 權威指南
- Laravel Application Development Blueprints
- Spring 5 Design Patterns
- Visual FoxPro 6.0程序設計
- Sitecore Cookbook for Developers
- Tkinter GUI Application Development Blueprints
- Citrix XenDesktop? Cookbook(Third Edition)