> import torch

> torch.version.__version__

'2.0.1+cpu'

顯然這個不支援cuda

> a = torch.ones(3,3)

> b = torch.ones(3,3)

> a = a.to('cuda')

   b = b.to('cuda')

   a+b

pytorch官網

  > pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

 

 

> torch.version.__version__

'2.0.1+cu118'

 

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 me1237guy 的頭像
    me1237guy

    天天向上

    me1237guy 發表在 痞客邦 留言(0) 人氣()