- 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)
推薦閱讀
- JavaScript+jQuery開發實戰
- 嚴密系統設計:方法、趨勢與挑戰
- GeoServer Beginner's Guide(Second Edition)
- Drupal 8 Module Development
- 琢石成器:Windows環境下32位匯編語言程序設計
- HDInsight Essentials(Second Edition)
- Visual Basic程序設計實踐教程
- SQL經典實例(第2版)
- Natural Language Processing with Java and LingPipe Cookbook
- 區塊鏈技術進階與實戰(第2版)
- Beginning C++ Game Programming
- Hadoop 2.X HDFS源碼剖析
- C++程序設計教程(第2版)
- 從Power BI到Analysis Services:企業級數據分析實戰
- Java面向對象程序設計教程