File size: 179 Bytes
45311fe
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
import torch

"""
Transform the torch logits into probabilities.
"""
def softmax(logits):
    probs = torch.softmax(torch.from_numpy(logits).float(), -1).numpy()
    return probs