pytorch
CPU版本安装:pip install torch==1.3.0+cpu torchvision==0.4.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
GPU版本安装:pip install torch===1.3.0 torchvision===0.4.1 -f https://download.pytorch.org/whl/torch_stable (默认是CUDA10版本)
- 查看版本与显卡型号
- 创建随机矩阵
x = torch.empty(5, 3)
# 符合高斯分布的随机
x = torch.rand(5, 3)
# 全0 矩阵
x = torch.zeros(5, 3, dtype=torch.long)
# 创建张量
x = torch.tensor([5.5, 3])
- 加法操作
-