def __init__(self, alpha, beta, validate_args=True, allow_nan_stats=False, name='Gamma'):
    'Construct Gamma distributions with parameters `alpha` and `beta`.\n\n    The parameters `alpha` and `beta` must be shaped in a way that supports\n    broadcasting (e.g. `alpha + beta` is a valid operation).\n\n    Args:\n      alpha: Floating point tensor, the shape params of the\n        distribution(s).\n        alpha must contain only positive values.\n      beta: Floating point tensor, the inverse scale params of the\n        distribution(s).\n        beta must contain only positive values.\n      validate_args: Whether to assert that `a > 0, b > 0`, and that `x > 0` in\n        the methods `prob(x)` and `log_prob(x)`.  If `validate_args` is `False`\n        and the inputs are invalid, correct behavior is not guaranteed.\n      allow_nan_stats:  Boolean, default `False`.  If `False`, raise an\n        exception if a statistic (e.g. mean/mode/etc...) is undefined for any\n        batch member.  If `True`, batch members with valid parameters leading to\n        undefined statistics will return NaN for this statistic.\n      name: The name to prepend to all ops created by this distribution.\n\n    Raises:\n      TypeError: if `alpha` and `beta` are different dtypes.\n    '
    self._allow_nan_stats = allow_nan_stats
    self._validate_args = validate_args
    with ops.name_scope(name, values=[alpha, beta]) as scope:
        self._name = scope
        with ops.control_dependencies(([check_ops.assert_positive(alpha), check_ops.assert_positive(beta)] if validate_args else [])):
            alpha = array_ops.identity(alpha, name='alpha')
            beta = array_ops.identity(beta, name='beta')
            contrib_tensor_util.assert_same_float_dtype((alpha, beta))
            self._broadcast_tensor = (alpha + beta)
    self._get_batch_shape = self._broadcast_tensor.get_shape()
    self._get_event_shape = tensor_shape.TensorShape([])
    self._alpha = alpha
    self._beta = beta
Construct Gamma distributions with parameters `alpha` and `beta`.

The parameters `alpha` and `beta` must be shaped in a way that supports
broadcasting (e.g. `alpha + beta` is a valid operation).

Args:
  alpha: Floating point tensor, the shape params of the
    distribution(s).
    alpha must contain only positive values.
  beta: Floating point tensor, the inverse scale params of the
    distribution(s).
    beta must contain only positive values.
  validate_args: Whether to assert that `a > 0, b > 0`, and that `x > 0` in
    the methods `prob(x)` and `log_prob(x)`.  If `validate_args` is `False`
    and the inputs are invalid, 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 prepend to all ops created by this distribution.

Raises:
  TypeError: if `alpha` and `beta` are different dtypes.
def __init__(self, alpha, beta, validate_args=True, allow_nan_stats=False, name='Gamma'):
    'Construct Gamma distributions with parameters `alpha` and `beta`.\n\n    The parameters `alpha` and `beta` must be shaped in a way that supports\n    broadcasting (e.g. `alpha + beta` is a valid operation).\n\n    Args:\n      alpha: Floating point tensor, the shape params of the\n        distribution(s).\n        alpha must contain only positive values.\n      beta: Floating point tensor, the inverse scale params of the\n        distribution(s).\n        beta must contain only positive values.\n      validate_args: Whether to assert that `a > 0, b > 0`, and that `x > 0` in\n        the methods `prob(x)` and `log_prob(x)`.  If `validate_args` is `False`\n        and the inputs are invalid, correct behavior is not guaranteed.\n      allow_nan_stats:  Boolean, default `False`.  If `False`, raise an\n        exception if a statistic (e.g. mean/mode/etc...) is undefined for any\n        batch member.  If `True`, batch members with valid parameters leading to\n        undefined statistics will return NaN for this statistic.\n      name: The name to prepend to all ops created by this distribution.\n\n    Raises:\n      TypeError: if `alpha` and `beta` are different dtypes.\n    '
    self._allow_nan_stats = allow_nan_stats
    self._validate_args = validate_args
    with ops.name_scope(name, values=[alpha, beta]) as scope:
        self._name = scope
        with ops.control_dependencies(([check_ops.assert_positive(alpha), check_ops.assert_positive(beta)] if validate_args else [])):
            alpha = array_ops.identity(alpha, name='alpha')
            beta = array_ops.identity(beta, name='beta')
            contrib_tensor_util.assert_same_float_dtype((alpha, beta))
            self._broadcast_tensor = (alpha + beta)
    self._get_batch_shape = self._broadcast_tensor.get_shape()
    self._get_event_shape = tensor_shape.TensorShape([])
    self._alpha = alpha
    self._beta = beta