Gautam_Bhattacharya:

cosine_scores[ind,:] = F.log_softmax(cosine_score.data)


It would be better to implement it in this way:
cosine_scores = []
for enr in enroll_embs:
     cosin_scores.append(.....)

cosin_scores = torch.stack(cosine_scores)