code: def _softmax(x, xp):
      val = xp.exp(x - xp.amax(x, axis=2, keepdims=True))
      val /= xp.sum(val, axis=2, keepdims=True)
      return val
  
imports: import numpy
  import six
  import chainer
  from chainer import backend
  from chainer.backends import cuda
  from chainer import function
  from chainer import utils
  from chainer.utils import collections_abc
  from chainer.utils import type_check
label_desc: Use image node_id 2 for calling a global function with example usage: _softmax(x, xp) and returns: val