(score, g_pnt_idxs)
return loss
score = [B, T, max_seq_length]
score = [B, T, max_seq_length]
score = [ B T max_seq_length ]
def Loss_s2s(score, g_pnt_idxs):
    """
    score = [B, T, max_seq_length]
    """
    #         WHERE string part
    loss = 0

    for b, g_pnt_idxs1 in enumerate(g_pnt_idxs):
        ed = len(g_pnt_idxs1) - 1
        score_part = score[b, :ed]
        loss += F.cross_entropy(score_part, torch.tensor(g_pnt_idxs1[1:]).to(device))  # +1 shift.
    return loss
def Loss_s2s ( score , g_pnt_idxs ) : #         WHERE string part loss = 0 for b , g_pnt_idxs1 in enumerate ( g_pnt_idxs ) : ed = len ( g_pnt_idxs1 ) - 1 score_part = score [ b , : ed ] loss += F . cross_entropy ( score_part , torch . tensor ( g_pnt_idxs1 [ 1 : ] ) . to ( device ) ) # +1 shift. return loss