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"]
code: def __init__(
      self, num_events, prob=None, logit=None, validate_args=None
  ):
      if num_events > 0:
          num_events = int(num_events)
          self.num_events = num_events
      else:
          raise ValueError(
              "`num_events` should be greater than zero. "
              + "Received num_events={}".format(num_events)
          )
      if (prob is None) == (logit is None):
          raise ValueError(
              "Either `prob` or `logit` must be specified, but not both. "
              + "Received prob={}, logit={}".format(prob, logit)
          )
  
      if prob is not None:
          self.prob = prob
      else:
          self.logit = logit
  
      super(Categorical, self).__init__(
          event_dim=0, validate_args=validate_args
      )
  
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 1 to create a new Categorical object from inherited base classes: Distribution with example: obj = Categorical(num_events, prob, logit, validate_args)