The code is here. But the code is not quite organized. It has other problems prevent me from using nn.DataParallel only this one I cannot solve.

  
      github.com
  
  
    lifanchen-simm/transformerCPI/blob/f9301880740975ddc1d56ce19f9eb52a6ad75933/Kinase/model.py#L315 3

    # protein = torch.unsqueeze(protein, dim=0)
    # protein =[ batch size=1,protein len, protein_dim]
    enc_src = self.encoder(protein)
    # enc_src = [batch size, protein len, hid dim]

    out = self.decoder(compound, enc_src, compound_mask, protein_mask)
    # out = [batch size, 2]
    # out = torch.squeeze(out, dim=0)
    return out

def __call__(self, data, train=True):

    compound, adj, protein, correct_interaction ,atom_num,protein_num = data
    # compound = compound.to(self.device)
    # adj = adj.to(self.device)
    # protein = protein.to(self.device)
    # correct_interaction = correct_interaction.to(self.device)
    #scale = torch.tensor([1.0,4.0], device=self.device)
    Loss = nn.CrossEntropyLoss()

    if train: