摘要:
介绍 图片摘自stackoverflow: what-is-the-difference-between-fit-fit-transform-and-transform 例一 from sklearn.preprocessing import StandardScaler ss = Standard 阅读全文
摘要:
把数据从CPU迁移到GPU时,可以用.cuda()方法,也可以用.to(device)方法。示例如下。 .cuda()方法 import torch import time t = time.time() b = torch.rand([1024, 1024, 10]) b = b.cuda() p 阅读全文
摘要:
模型和数据可以在CPU和GPU上来回迁移,怎么判断模型和数据在哪里呢? import torch import torch.nn as nn # 判断模型是在CPU还是GPU上 model = nn.LSTM(input_size=10, hidden_size=4, num_layers=1, b 阅读全文