code: def softmax(x):
      if len(x.shape) > 1:
          tmp = np.max(x, axis=1)
          x -= tmp.reshape((x.shape[0], 1))
          x = np.exp(x)
          tmp = np.sum(x, axis=1)
          x /= tmp.reshape((x.shape[0], 1))
      else:
          tmp = np.max(x)
          x -= tmp
          x = np.exp(x)
          tmp = np.sum(x)
          x /= tmp
      return x
  
file_path: PaddleHub/modules/image/classification/resnet50_vd_dishes/processor.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import base64
  import cv2
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: softmax(x) and returns: x