实验操作的总结

  1. 指定在哪些gpu跑
torch.cuda.set_device(7)###设置7好gpu
d2l.try_gpu()#当前gpu
  1. conda批量安装
conda install --file=requirements.txt
pip install --r requirements.txt
  1. cuda对应的torch版本
    后面需要指定网址如
pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 -f https://download.pytorch.org/whl/torch_stable.html
  1. conda env clone
conda create --name python32(新名字) --clone python321(老名字)

conda remove --name old_name --all
  1. 对torch.tensor的元素进行判定,最后设为目标值,也就是矩阵对应元素运算
torch.where(condition,a,b)
  1. np的数组方法
    如:where(condition,x,y) where(condition) argwhere(condition)

使用numpy提供的函数concatenate((a1,a2,…,an),axis = 0)
axis = 0, 按行拼接
axis = 1, 按列拼接

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值