parameters: (self,
                 n,
                 alpha,
                 validate_args=True,
                 allow_nan_stats=False,
                 name="DirichletMultinomial")
docstring: Initialize a batch of DirichletMultinomial distributions.
  
      Args:
        n:  Non-negative floating point tensor, whose dtype is the same as
          `alpha`. The shape is broadcastable to `[N1,..., Nm]` with `m >= 0`.
          Defines this as a batch of `N1 x ... x Nm` different Dirichlet
          multinomial distributions. Its components should be equal to integer
          values.
        alpha: Positive floating point tensor, whose dtype is the same as
          `n` with shape broadcastable to `[N1,..., Nm, k]` `m >= 0`.  Defines
          this as a batch of `N1 x ... x Nm` different `k` class Dirichlet
          multinomial distributions.
        validate_args: Whether to assert valid values for parameters `alpha` and
          `n`, and `x` in `prob` and `log_prob`.  If `False`, correct behavior is
          not guaranteed.
        allow_nan_stats:  Boolean, default `False`.  If `False`, raise an
          exception if a statistic (e.g. mean/mode/etc...) is undefined for any
          batch member.  If `True`, batch members with valid parameters leading to
          undefined statistics will return NaN for this statistic.
        name: The name to prefix Ops created by this distribution class.
  
      Examples:
  
      ```python
      # Define 1-batch of 2-class Dirichlet multinomial distribution,
      # also known as a beta-binomial.
      dist = DirichletMultinomial(2.0, [1.1, 2.0])
  
      # Define a 2-batch of 3-class distributions.
      dist = DirichletMultinomial([3., 4], [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]])
      ```
docstring_summary: Initialize a batch of DirichletMultinomial distributions.
docstring_tokens: Initialize a batch of DirichletMultinomial distributions .
function: def __init__(self,
                 n,
                 alpha,
                 validate_args=True,
                 allow_nan_stats=False,
                 name="DirichletMultinomial"):
      """Initialize a batch of DirichletMultinomial distributions.
  
      Args:
        n:  Non-negative floating point tensor, whose dtype is the same as
          `alpha`. The shape is broadcastable to `[N1,..., Nm]` with `m >= 0`.
          Defines this as a batch of `N1 x ... x Nm` different Dirichlet
          multinomial distributions. Its components should be equal to integer
          values.
        alpha: Positive floating point tensor, whose dtype is the same as
          `n` with shape broadcastable to `[N1,..., Nm, k]` `m >= 0`.  Defines
          this as a batch of `N1 x ... x Nm` different `k` class Dirichlet
          multinomial distributions.
        validate_args: Whether to assert valid values for parameters `alpha` and
          `n`, and `x` in `prob` and `log_prob`.  If `False`, correct behavior is
          not guaranteed.
        allow_nan_stats:  Boolean, default `False`.  If `False`, raise an
          exception if a statistic (e.g. mean/mode/etc...) is undefined for any
          batch member.  If `True`, batch members with valid parameters leading to
          undefined statistics will return NaN for this statistic.
        name: The name to prefix Ops created by this distribution class.
  
      Examples:
  
      ```python
      # Define 1-batch of 2-class Dirichlet multinomial distribution,
      # also known as a beta-binomial.
      dist = DirichletMultinomial(2.0, [1.1, 2.0])
  
      # Define a 2-batch of 3-class distributions.
      dist = DirichletMultinomial([3., 4], [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]])
      ```
  
      """
      self._allow_nan_stats = allow_nan_stats
      self._validate_args = validate_args
      self._name = name
      with ops.op_scope([n, alpha], name):
        # Broadcasting works because:
        # * The broadcasting convention is to prepend dimensions of size [1], and
        #   we use the last dimension for the distribution, wherease
        #   the batch dimensions are the leading dimensions, which forces the
        #   distribution dimension to be defined explicitly (i.e. it cannot be
        #   created automatically by prepending).  This forces enough
        #   explicitivity.
        #   * All calls involving `counts` eventually require a broadcast between
        #   `counts` and alpha.
        self._alpha = self._check_alpha(alpha)
        self._n = self._check_n(n)
  
        self._alpha_sum = math_ops.reduce_sum(
            self._alpha, reduction_indices=[-1], keep_dims=False)
  
        self._get_batch_shape = self._alpha_sum.get_shape()
  
        # event shape depends only on alpha, not "n".
        self._get_event_shape = self._alpha.get_shape().with_rank_at_least(1)[-1:]
function_tokens: def __init__ ( self , n , alpha , validate_args = True , allow_nan_stats = False , name = "DirichletMultinomial" ) : self . _allow_nan_stats = allow_nan_stats self . _validate_args = validate_args self . _name = name with ops . op_scope ( [ n , alpha ] , name ) : # Broadcasting works because: # * The broadcasting convention is to prepend dimensions of size [1], and #   we use the last dimension for the distribution, wherease #   the batch dimensions are the leading dimensions, which forces the #   distribution dimension to be defined explicitly (i.e. it cannot be #   created automatically by prepending).  This forces enough #   explicitivity. #   * All calls involving `counts` eventually require a broadcast between #   `counts` and alpha. self . _alpha = self . _check_alpha ( alpha ) self . _n = self . _check_n ( n ) self . _alpha_sum = math_ops . reduce_sum ( self . _alpha , reduction_indices = [ - 1 ] , keep_dims = False ) self . _get_batch_shape = self . _alpha_sum . get_shape ( ) # event shape depends only on alpha, not "n". self . _get_event_shape = self . _alpha . get_shape ( ) . with_rank_at_least ( 1 ) [ - 1 : ]