官术网_书友最值得收藏!

  • 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)
主站蜘蛛池模板: 怀仁县| 金阳县| 临洮县| 尉氏县| 上饶县| 隆回县| 湘西| 景泰县| 凉城县| 嘉禾县| 襄垣县| 昭苏县| 安西县| 子长县| 兰溪市| 安新县| 莒南县| 双江| 鄄城县| 错那县| 克什克腾旗| 永年县| 淄博市| 开远市| 巴彦淖尔市| 茌平县| 清新县| 南郑县| 福安市| 永兴县| 汝城县| 鹤山市| 萨嘎县| 剑川县| 彰化市| 昌黎县| 沭阳县| 灵丘县| 宽城| 额敏县| 日照市|