code: def prob2logit(prob, binary=True):
      r"""Convert probability to logit form.
      For the binary case, the logit stands for log(p / (1 - p)).
      Whereas for the multinomial case, the logit denotes log(p).
      """
      _clipped_prob = _clip_prob(prob)
      if binary:
          return np.log(_clipped_prob) - np.log1p(-_clipped_prob)
      # The clipped prob would cause numerical error in the categorical case,
      # no idea about the reason behind.
      return np.log(_clipped_prob)
  
file_path: mxnet/python/mxnet/gluon/probability/distributions/utils.py
imports: from functools import update_wrapper
  from numbers import Number
  import numpy
  from ....None import np, npx
label_desc: Use image node_id 10 for calling a global function with example usage: prob2logit(prob, binary) and returns: np, unknown