Sorry, just the line before referenced.
model = Predictor(encoder, decoder, device)
# model.load_state_dict(torch.load("output/model/lr=0.001,dropout=0.1,lr_decay=0.5"))
model = nn.DataParallel(model, device_ids=[0,1,2,3])  # I add the code here
model.to(device)


  
      github.com
  
  
    lifanchen-simm/transformerCPI/blob/f9301880740975ddc1d56ce19f9eb52a6ad75933/Kinase/main.py#L68 1

batch = 64
lr = 1e-4
weight_decay = 1e-4
iteration = 300
kernel_size = 9

encoder = Encoder(protein_dim, hid_dim, n_layers, kernel_size, dropout, device)
decoder = Decoder(atom_dim, hid_dim, n_layers, n_heads, pf_dim, DecoderLayer, SelfAttention, PositionwiseFeedforward, dropout, device)
model = Predictor(encoder, decoder, device)
# model.load_state_dict(torch.load("output/model/lr=0.001,dropout=0.1,lr_decay=0.5"))
model.to(device)
trainer = Trainer(model, lr, weight_decay, batch)
tester = Tester(model)

"""Output files."""
file_AUCs = 'output/result/AUCs--lr=1e-4,dropout=0.1,weight_decay=1e-4,kernel=9,n_layer=3,batch=64,balance,lookaheadradam'+ '.txt'
file_model = 'output/model/' + 'lr=1e-4,dropout=0.1,weight_decay=1e-4,kernel=9,n_layer=3,batch=64,balance,lookaheadradam'
AUC = ('Epoch\tTime(sec)\tLoss_train\tAUC_dev\tPRC_dev')
with open(file_AUCs, 'w') as f:
    f.write(AUC + '\n')