code: def softmax(logits):
      """
      logits: N x d
      """
      max_value = np.max(logits, axis=1, keepdims=True)
      exp = np.exp(logits - max_value)
      exp_sum = np.sum(exp, axis=1, keepdims=True)
      dist = exp / exp_sum
      return dist
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import cv2
  import math
  import numpy
  from itertools import groupby
  from skimage.morphology._skeletonize import thin
label_desc: Use image node_id 2 for calling a global function with example usage: softmax(logits) and returns: dist