摘要: 5.6.1 计算设备 import torch from torch import nn torch.device('cpu'), torch.device('cuda:0') # cuda等价于cuda:0(只有一块显卡没法试别的块号) (device(type='cpu'), device(ty 阅读全文
posted @ 2023-09-14 07:57 AncilunKiang 阅读(176) 评论(0) 推荐(0)
摘要: 5.5.1 加载和保存 import torch from torch import nn from torch.nn import functional as F x = torch.arange(4) torch.save(x, 'x-file') # 使用 save 保存 x2 = torch 阅读全文
posted @ 2023-09-14 07:56 AncilunKiang 阅读(103) 评论(0) 推荐(0)