class_docstr: Create a categorical distribution object.
  
  Parameters
  ----------
  num_events : Int
      Number of events.
  prob : Tensor
      Probabilities of each event.
  logit : Tensor
      The log-odds of each event
class_docstr_tok: ["Create","a","categorical","distribution","object",".","Parameters","--","--","--","--","--","num_events",":","Int","Number","of","events",".","prob",":","Tensor","Probabilities","of","each","event",".","logit",":","Tensor","The","log-odds","of","each","event"]
docstr: Compute the log-likelihood of `value`
  
  Parameters
  ----------
  value : Tensor
      samples from Categorical distribution
  
  Returns
  -------
  Tensor
      log-likelihood of `value`
docstr_tok: ["Compute","the","log-likelihood","of","`","value","`","Parameters","--","--","--","--","--","value",":","Tensor","samples","from","Categorical","distribution","Returns","--","--","--","-","Tensor","log-likelihood","of","`","value","`"]
code: def log_prob(self, value):
      """Compute the log-likelihood of `value`
  
      Parameters
      ----------
      value : Tensor
          samples from Categorical distribution
  
      Returns
      -------
      Tensor
          log-likelihood of `value`
      """
      if self._validate_args:
          self._validate_samples(value)
      logit = self.logit
      indices = np.expand_dims(value, -1).astype("int")
      expanded_logit = logit * np.ones_like(
          logit + indices
      )  # pylint: disable=too-many-function-args
      return npx.pick(expanded_logit, indices).squeeze()
  
file_path: mxnet/python/mxnet/gluon/probability/distributions/categorical.py
imports: from .distribution import Distribution
  from .utils import prob2logit, logit2prob, cached_property, sample_n_shape_converter
  from .constraint import Simplex, Real, IntegerInterval
  from ....None import np, npx
label_desc: Use image node_id 5 for calling the Categorical obj's underlying member method code with example usage: obj.log_prob(value) and returns: npx