class_docstr: Helper class for creating the log of a
  categorical distribution object.
  
  Parameters
  ----------
  T : scalar, default None
      Relaxation temperature
  num_events : Int
      Number of events.
  prob : Tensor
      Probabilities of each event.
  logit : Tensor
      The log-odds of each event
class_docstr_tok: ["Helper","class","for","creating","the","log","of","a","categorical","distribution","object",".","Parameters","--","--","--","--","--","T",":","scalar",",","default","None","Relaxation","temperature","num_events",":","Int","Number","of","events",".","prob",":","Tensor","Probabilities","of","each","event",".","logit",":","Tensor","The","log-odds","of","each","event"]
code: def sample(self, size=None):
      if size is None:
          size = ()
          logit = self.logit
      else:
          if isinstance(size, int):
              logit = np.broadcast_to(self.logit, (size) + (-2,))
          else:
              logit = np.broadcast_to(self.logit, size + (-2,))
      scores = np.random.gumbel(logit) / self.T
      return np.log(npx.softmax(scores, axis=-1) + 1e-20)
  
file_path: mxnet/python/mxnet/gluon/probability/distributions/relaxed_one_hot_categorical.py
imports: from math import lgamma
  from .distribution import Distribution
  from .transformed_distribution import TransformedDistribution
  from ..transformation import ExpTransform
  from .utils import prob2logit, logit2prob, cached_property
  from .constraint import Real, Simplex
  from ....None import np, npx
label_desc: Use image node_id 5 for calling the _LogRelaxedOneHotCategorical obj's underlying member method code with example usage: obj.sample(size) and returns: np