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

  • 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)
主站蜘蛛池模板: 于都县| 湾仔区| 鄄城县| 沁源县| 海宁市| 万安县| 邹平县| 贡嘎县| 延津县| 承德县| 买车| 大理市| 江阴市| 三原县| 洞口县| 温州市| 阿图什市| 股票| 闽清县| 巴彦县| 中宁县| 内乡县| 闸北区| 彭山县| 沿河| 丹棱县| 巧家县| 玉树县| 象山县| 阜宁县| 浮山县| 龙口市| 通江县| 东源县| 哈尔滨市| 凤城市| 潢川县| 内丘县| 小金县| 乌拉特中旗| 旬邑县|