class_docstr: OneHotCategorical distribution.
  
  The categorical distribution is parameterized by the log-probabilities
  of a set of classes. The difference between OneHotCategorical and Categorical
  distributions is that OneHotCategorical is a discrete distribution over
  one-hot bit vectors whereas Categorical is a discrete distribution over
  positive integers. OneHotCategorical is equivalent to Categorical except
  Categorical has event_dim=() while OneHotCategorical has event_dim=K, where
  K is the number of classes.
  
  This class provides methods to create indexed batches of OneHotCategorical
  distributions. If the provided `logits` or `probs` is rank 2 or higher, for
  every fixed set of leading dimensions, the last dimension represents one
  single OneHotCategorical distribution. When calling distribution
  functions (e.g. `dist.prob(x)`), `logits` and `x` are broadcast to the
  same shape (if possible). In all cases, the last dimension of `logits,x`
  represents single OneHotCategorical distributions.
  
  #### Examples
  
  Creates a 3-class distribution, with the 2nd class, the most likely to be
  drawn from.
  
  ```python
  p = [0.1, 0.5, 0.4]
  dist = OneHotCategorical(probs=p)
  ```
  
  Creates a 3-class distribution, with the 2nd class the most likely to be
  drawn from, using logits.
  
  ```python
  logits = [-2, 2, 0]
  dist = OneHotCategorical(logits=logits)
  ```
  
  Creates a 3-class distribution, with the 3rd class is most likely to be drawn.
  
  ```python
  # counts is a scalar.
  p = [0.1, 0.4, 0.5]
  dist = OneHotCategorical(probs=p)
  dist.prob([0,1,0])  # Shape []
  
  # p will be broadcast to [[0.1, 0.4, 0.5], [0.1, 0.4, 0.5]] to match.
  samples = [[0,1,0], [1,0,0]]
  dist.prob(samples)  # Shape [2]
  ```
code: def _parameter_control_dependencies(self, is_init):
      assertions = []
  
      logits = self._logits
      probs = self._probs
      param, name = (
          (probs, "probs") if logits is None else (logits, "logits")
      )
  
      # In init, we can always build shape and dtype checks because
      # we assume shape doesn't change for Variable backed args.
      if is_init:
          if not dtype_util.is_floating(param.dtype):
              raise TypeError(
                  "Argument `{}` must having floating type.".format(
                      name
                  )
              )
  
          msg = "Argument `{}` must have rank at least 1.".format(name)
          shape_static = tensorshape_util.dims(param.shape)
          if shape_static is not None:
              if len(shape_static) < 1:
                  raise ValueError(msg)
          elif self.validate_args:
              param = tf.convert_to_tensor(param)
              assertions.append(
                  assert_util.assert_rank_at_least(
                      param, 1, message=msg
                  )
              )
              with tf.control_dependencies(assertions):
                  param = tf.identity(param)
  
          msg1 = "Argument `{}` must have final dimension >= 1.".format(
              name
          )
          msg2 = (
              "Argument `{}` must have final dimension <= {}.".format(
                  name, dtype_util.max(tf.int32)
              )
          )
          event_size = (
              shape_static[-1] if shape_static is not None else None
          )
          if event_size is not None:
              if event_size < 1:
                  raise ValueError(msg1)
              if event_size > dtype_util.max(tf.int32):
                  raise ValueError(msg2)
          elif self.validate_args:
              param = tf.convert_to_tensor(param)
              assertions.append(
                  assert_util.assert_greater_equal(
                      tf.shape(param)[-1], 1, message=msg1
                  )
              )
              # NOTE: For now, we leave out a runtime assertion that
              # `tf.shape(param)[-1] <= tf.int32.max`.  An earlier `tf.shape` call
              # will fail before we get to this point.
  
      if not self.validate_args:
          assert not assertions  # Should never happen.
          return []
  
      if probs is not None:
          probs = param  # reuse tensor conversion from above
          if is_init != tensor_util.is_ref(probs):
              probs = tf.convert_to_tensor(probs)
              one = tf.ones([], dtype=probs.dtype)
              assertions.extend(
                  [
                      assert_util.assert_non_negative(probs),
                      assert_util.assert_less_equal(probs, one),
                      assert_util.assert_near(
                          tf.reduce_sum(probs, axis=-1),
                          one,
                          message="Argument `probs` must sum to 1.",
                      ),
                  ]
              )
  
      return assertions
  
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import softmax_centered
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import reparameterization
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.internal import tensorshape_util
label_desc: Use image node_id 21 for calling the OneHotCategorical obj's underlying member method code with example usage: obj._parameter_control_dependencies(is_init) and returns: assertions, list