class_docstr: Base class for parameterized probability distributions.
  
  Distributions in Pyro are stochastic function objects with :meth:`sample` and
  :meth:`log_prob` methods. Distribution are stochastic functions with fixed
  parameters::
  
    d = dist.Bernoulli(param)
    x = d()                                # Draws a random sample.
    p = d.log_prob(x)                      # Evaluates log probability of x.
  
  **Implementing New Distributions**:
  
  Derived classes must implement the methods: :meth:`sample`,
  :meth:`log_prob`.
  
  **Examples**:
  
  Take a look at the `examples <http://pyro.ai/examples>`_ to see how they interact
  with inference algorithms.
class_docstr_tok: ["Base","class","for","parameterized","probability","distributions",".","Distributions","in","Pyro","are","stochastic","function","objects","with",":","meth",":","`","sample","`","and",":","meth",":","`","log_prob","`","methods",".","Distribution","are","stochastic","functions","with","fixed","parameters",":",":","d","=","dist.Bernoulli","(","param",")","x","=","d","(",")","#","Draws","a","random","sample",".","p","=","d.log_prob","(","x",")","#","Evaluates","log","probability","of","x",".","*","*","Implementing","New","Distributions","*","*",":","Derived","classes","must","implement","the","methods",":",":","meth",":","`","sample","`",",",":","meth",":","`","log_prob","`",".","*","*","Examples","*","*",":","Take","a","look","at","the","`","examples","<","http",":","\/\/pyro.ai\/examples",">","`","_","to","see","how","they","interact","with","inference","algorithms","."]
docstr: EXPERIMENTAL Switch to the Random Variable DSL for applying transformations
  to random variables. Supports either chaining operations or arithmetic
  operator overloading.
  
  Example usage::
  
      # This should be equivalent to an Exponential distribution.
      Uniform(0, 1).rv.log().neg().dist
  
      # These two distributions Y1, Y2 should be the same
      X = Uniform(0, 1).rv
      Y1 = X.mul(4).pow(0.5).sub(1).abs().neg().dist
      Y2 = (-abs((4*X)**(0.5) - 1)).dist
  
  
  :return: A :class: `~pyro.contrib.randomvariable.random_variable.RandomVariable`
      object wrapping this distribution.
  :rtype: ~pyro.contrib.randomvariable.random_variable.RandomVariable
docstr_tok: ["EXPERIMENTAL","Switch","to","the","Random","Variable","DSL","for","applying","transformations","to","random","variables",".","Supports","either","chaining","operations","or","arithmetic","operator","overloading",".","Example","usage",":",":","#","This","should","be","equivalent","to","an","Exponential","distribution",".","Uniform","(","0",",","1",")",".rv.log","(",")",".neg","(",")",".dist","#","These","two","distributions","Y1",",","Y2","should","be","the","same","X","=","Uniform","(","0",",","1",")",".rv","Y1","=","X.mul","(","4",")",".pow","(","0.5",")",".sub","(","1",")",".abs","(",")",".neg","(",")",".dist","Y2","=","(","-abs","(","(","4","*","X",")","*","*","(","0.5",")","-","1",")",")",".dist",":","return",":","A",":","class",":","`","~pyro.contrib.randomvariable.random_variable.RandomVariable","`","object","wrapping","this","distribution",".",":","rtype",":","~pyro.contrib.randomvariable.random_variable.RandomVariable"]
code: def rv(self):
      """
      EXPERIMENTAL Switch to the Random Variable DSL for applying transformations
      to random variables. Supports either chaining operations or arithmetic
      operator overloading.
  
      Example usage::
  
          # This should be equivalent to an Exponential distribution.
          Uniform(0, 1).rv.log().neg().dist
  
          # These two distributions Y1, Y2 should be the same
          X = Uniform(0, 1).rv
          Y1 = X.mul(4).pow(0.5).sub(1).abs().neg().dist
          Y2 = (-abs((4*X)**(0.5) - 1)).dist
  
  
      :return: A :class: `~pyro.contrib.randomvariable.random_variable.RandomVariable`
          object wrapping this distribution.
      :rtype: ~pyro.contrib.randomvariable.random_variable.RandomVariable
      """
      from pyro.contrib.randomvariable import RandomVariable
  
      return RandomVariable(self)
  
file_path: pyro/pyro/distributions/distribution.py
imports: import functools
  import inspect
  from abc import ABCMeta, abstractmethod
  import torch
  from pyro.distributions.score_parts import ScoreParts
label_desc: Use image node_id 8 for calling the Distribution obj's underlying member method code with example usage: obj.rv() and returns: RandomVariable