code: def softmax(
      data,
      axis=-1,
      length=None,
      temperature=None,
      use_length=False,
      dtype=None,
  ):
      r"""Applies the softmax function.
  
      The resulting array contains elements in the range (0,1) and the elements along the given axis sum up to 1.
  
      .. math::
         softmax(\mathbf{z/t})_j = \frac{e^{z_j/t}}{\sum_{k=1}^K e^{z_k/t}}
  
      for :math:`j = 1, ..., K`
  
      t is the temperature parameter in softmax function. By default, t equals 1.0
  
      Parameters
      ----------
      data : NDArray
          The input array.
      axis : int, optional, default='-1'
          The axis along which to compute softmax.
      length : NDArray
          The length array.
      temperature : double or None, optional, default=None
          Temperature parameter in softmax
      dtype : {None, 'float16', 'float32', 'float64'},optional, default='None'
          DType of the output in case this can't be inferred. Defaults to
          the same as input's dtype if not defined (dtype=None).
      use_length : boolean or None, optional, default=0
          Whether to use the length input as a mask over the data input.
  
      Returns
      -------
      out : NDArray or list of NDArrays
          The output of this function.
  
      Example
      -------
      >>> data = np.ones((2, 3))
      >>> npx.softmax(data, axis=0)
      array([[0.5, 0.5, 0.5],
          [0.5, 0.5, 0.5]])
      >>> npx.softmax(data, axis=1)
      array([[0.33333334, 0.33333334, 0.33333334],
          [0.33333334, 0.33333334, 0.33333334]])
      """
      if dtype and not isinstance(dtype, str):
          dtype = get_dtype_name(dtype)
      if use_length:
          assert length is not None, "Missing length input"
          return _api_internal.softmax(
              data, length, axis, temperature, True, dtype
          )
      else:
          assert length is None, "Length input is not used"
          return _api_internal.softmax(
              data, axis, temperature, False, dtype
          )
  
imports: import numpy
  from .._internal import NDArrayBase
  from .None import _api_internal
  from ...util import set_module
  from ..ndarray import get_dtype_name
label_desc: Use image node_id 1 for calling a global function with example usage: softmax(data, axis, length, temperature, use_length, dtype) and returns: _api_internal, _api_internal