gpu: todevice
1)model层面
model = Net(in_feats=params.hidden_size,
n_hidden=params.hidden_size,
n_hidden_layers=1,
vocab_size=len(type2id)).to(device)
2)数据层面
for epoch in range(pa.EPOCH_NUM):
for batch_g, batch_e, batch_l in trainloader:
batch_g.to(device)
batch_e = batch_e.to(device)
batch_l = batch_l.to(device)