class_docstr: Bernoulli distribution.
  
  The Bernoulli distribution with `probs` parameter, i.e., the probability of a
  `1` outcome (vs a `0` outcome).
class_docstr_tok: ["Bernoulli","distribution",".","The","Bernoulli","distribution","with","`","probs","`","parameter",",","i.e.",",","the","probability","of","a","`","1","`","outcome","(","vs","a","`","0","`","outcome",")","."]
docstr: Construct Bernoulli distributions.
  
  Args:
    logits: An N-D `Tensor` representing the log-odds of a `1` event. Each
      entry in the `Tensor` parameterizes an independent Bernoulli
      distribution where the probability of an event is sigmoid(logits). Only
      one of `logits` or `probs` should be passed in.
    probs: An N-D `Tensor` representing the probability of a `1`
      event. Each entry in the `Tensor` parameterizes an independent
      Bernoulli distribution. Only one of `logits` or `probs` should be passed
      in.
    dtype: The type of the event samples. Default: `int32`.
    validate_args: Python `bool`, default `False`. When `True` distribution
      parameters are checked for validity despite possibly degrading runtime
      performance. When `False` invalid inputs may silently render incorrect
      outputs.
    allow_nan_stats: Python `bool`, default `True`. When `True`,
      statistics (e.g., mean, mode, variance) use the value "`NaN`" to
      indicate the result is undefined. When `False`, an exception is raised
      if one or more of the statistic's batch members are undefined.
    name: Python `str` name prefixed to Ops created by this class.
  
  Raises:
    ValueError: If p and logits are passed, or if neither are passed.
docstr_tok: ["Construct","Bernoulli","distributions",".","Args",":","logits",":","An","N-D","`","Tensor","`","representing","the","log-odds","of","a","`","1","`","event",".","Each","entry","in","the","`","Tensor","`","parameterizes","an","independent","Bernoulli","distribution","where","the","probability","of","an","event","is","sigmoid","(","logits",")",".","Only","one","of","`","logits","`","or","`","probs","`","should","be","passed","in",".","probs",":","An","N-D","`","Tensor","`","representing","the","probability","of","a","`","1","`","event",".","Each","entry","in","the","`","Tensor","`","parameterizes","an","independent","Bernoulli","distribution",".","Only","one","of","`","logits","`","or","`","probs","`","should","be","passed","in",".","dtype",":","The","type","of","the","event","samples",".","Default",":","`","int32","`",".","validate_args",":","Python","`","bool","`",",","default","`","False","`",".","When","`","True","`","distribution","parameters","are","checked","for","validity","despite","possibly","degrading","runtime","performance",".","When","`","False","`","invalid","inputs","may","silently","render","incorrect","outputs",".","allow_nan_stats",":","Python","`","bool","`",",","default","`","True","`",".","When","`","True","`",",","statistics","(","e.g.",",","mean",",","mode",",","variance",")","use","the","value","``","`","NaN","`","``","to","indicate","the","result","is","undefined",".","When","`","False","`",",","an","exception","is","raised","if","one","or","more","of","the","statistic","'s","batch","members","are","undefined",".","name",":","Python","`","str","`","name","prefixed","to","Ops","created","by","this","class",".","Raises",":","ValueError",":","If","p","and","logits","are","passed",",","or","if","neither","are","passed","."]
code: def __init__(
      self,
      logits=None,
      probs=None,
      dtype=tf.int32,
      validate_args=False,
      allow_nan_stats=True,
      name="Bernoulli",
  ):
      """Construct Bernoulli distributions.
  
      Args:
        logits: An N-D `Tensor` representing the log-odds of a `1` event. Each
          entry in the `Tensor` parameterizes an independent Bernoulli
          distribution where the probability of an event is sigmoid(logits). Only
          one of `logits` or `probs` should be passed in.
        probs: An N-D `Tensor` representing the probability of a `1`
          event. Each entry in the `Tensor` parameterizes an independent
          Bernoulli distribution. Only one of `logits` or `probs` should be passed
          in.
        dtype: The type of the event samples. Default: `int32`.
        validate_args: Python `bool`, default `False`. When `True` distribution
          parameters are checked for validity despite possibly degrading runtime
          performance. When `False` invalid inputs may silently render incorrect
          outputs.
        allow_nan_stats: Python `bool`, default `True`. When `True`,
          statistics (e.g., mean, mode, variance) use the value "`NaN`" to
          indicate the result is undefined. When `False`, an exception is raised
          if one or more of the statistic's batch members are undefined.
        name: Python `str` name prefixed to Ops created by this class.
  
      Raises:
        ValueError: If p and logits are passed, or if neither are passed.
      """
      parameters = dict(locals())
      if (probs is None) == (logits is None):
          raise ValueError("Must pass probs or logits, but not both.")
      with tf.name_scope(name) as name:
          self._probs = tensor_util.convert_nonref_to_tensor(
              probs, dtype_hint=tf.float32, name="probs"
          )
          self._logits = tensor_util.convert_nonref_to_tensor(
              logits, dtype_hint=tf.float32, name="logits"
          )
      super(Bernoulli, self).__init__(
          dtype=dtype,
          reparameterization_type=reparameterization.NOT_REPARAMETERIZED,
          validate_args=validate_args,
          allow_nan_stats=allow_nan_stats,
          parameters=parameters,
          name=name,
      )
  
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import sigmoid
  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
label_desc: Use image node_id 1 to create a new Bernoulli object from inherited base classes: distribution, distribution with example: obj = Bernoulli(logits, probs, dtype, validate_args, allow_nan_stats, name)