code: def softmax(x, axis=1):
      """Softmax function.
  
      This function computes its softmax along an axis. Let
      :math:`c = (c_1, c_2, \\dots, c_D)` be the slice of ``x`` along with
      the axis. For each slice :math:`c`, it computes the function :math:`f(c)`
      defined as :math:`f(c)={\\exp(c) \\over \\sum_{d} \\exp(c_d)}`.
  
      Args:
          x (:class:`~chainer.Variable` or :ref:`ndarray`):
              Input variable.
              A :math:`n`-dimensional (:math:`n \\geq 2`) float array.
          axis (int): The axis along which the softmax is to be computed.
  
      Returns:
          ~chainer.Variable: Output variable.
          A :math:`n`-dimensional (:math:`n \\geq 2`) float array, which is the
          same shape with x.
  
      .. admonition:: Example
  
          >>> x = np.array([[0, 1, 2], [0, 2, 4]], np.float32)
          >>> x
          array([[0., 1., 2.],
                 [0., 2., 4.]], dtype=float32)
          >>> y = F.softmax(x, axis=1)
          >>> y.array
          array([[0.09003057, 0.24472848, 0.66524094],
                 [0.01587624, 0.11731043, 0.86681336]], dtype=float32)
          >>> F.sum(y, axis=1).array
          array([1., 1.], dtype=float32)
  
      """
      return Softmax(axis=axis).apply((x,))[0]
  
file_path: chainer/chainer/functions/activation/softmax.py
imports: import chainer
  from chainer import backend
  from chainer.backends import cuda
  from chainer import function_node
  import chainer.functions
  from chainer.utils import type_check
label_desc: Use image node_id 1 for calling a global function with example usage: softmax(x, axis) and returns: Softmax