class_docstr: A categorical distribution over num_cats-many categories.
  
  Parameters
  ----------
  log_probs
      Tensor containing log probabilities of the individual categories, of
      shape `(*batch_shape, num_cats)`.
  F
class_docstr_tok: ["A","categorical","distribution","over","num_cats-many","categories",".","Parameters","--","--","--","--","--","log_probs","Tensor","containing","log","probabilities","of","the","individual","categories",",","of","shape","`","(","*","batch_shape",",","num_cats",")","`",".","F"]
code: def sample(self, num_samples=None, dtype=np.int32):
      def s(bin_probs):
          F = self.F
          indices = F.sample_multinomial(bin_probs)
          return indices
  
      return _sample_multiple(
          s, self.probs, num_samples=num_samples
      ).astype(dtype)
  
imports: from typing import List, Tuple
  import mxnet
  import numpy
  from gluonts.core.component import validated
  from gluonts.mx import Tensor
  from .distribution import Distribution, _sample_multiple, getF
  from .distribution_output import DistributionOutput
label_desc: Use image node_id 10 for calling the Categorical obj's underlying member method code with example usage: obj.sample(num_samples, dtype) and returns: _sample_multiple, indices