parameters: (scores)
return_statement: return probs
docstring: Compute softmax probability over raw logits.
docstring_summary: Compute softmax probability over raw logits.
docstring_tokens: Compute softmax probability over raw logits .
function: def _compute_softmax(scores):
    """Compute softmax probability over raw logits."""
    if not scores:
      return []
  
    max_score = None
    for score in scores:
      if max_score is None or score > max_score:
        max_score = score
  
    exp_scores = []
    total_sum = 0.0
    for score in scores:
      x = math.exp(score - max_score)
      exp_scores.append(x)
      total_sum += x
  
    probs = []
    for score in exp_scores:
      probs.append(score / total_sum)
    return probs
function_tokens: def _compute_softmax ( scores ) : if not scores : return [ ] max_score = None for score in scores : if max_score is None or score > max_score : max_score = score exp_scores = [ ] total_sum = 0.0 for score in scores : x = math . exp ( score - max_score ) exp_scores . append ( x ) total_sum += x probs = [ ] for score in exp_scores : probs . append ( score / total_sum ) return probs