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: Samples a random value (just an alias for ``.sample(*args, **kwargs)``).
  
  For tensor distributions, the returned tensor should have the same ``.shape`` as the
  parameters.
  
  :return: A random value.
  :rtype: torch.Tensor
docstr_tok: ["Samples","a","random","value","(","just","an","alias","for","``",".sample","(","*","args",",","*","*","kwargs",")","``",")",".","For","tensor","distributions",",","the","returned","tensor","should","have","the","same","``",".shape","``","as","the","parameters",".",":","return",":","A","random","value",".",":","rtype",":","torch.Tensor"]
code: def __call__(self, *args, **kwargs):
      """
      Samples a random value (just an alias for ``.sample(*args, **kwargs)``).
  
      For tensor distributions, the returned tensor should have the same ``.shape`` as the
      parameters.
  
      :return: A random value.
      :rtype: torch.Tensor
      """
      return self.sample(*args, **kwargs)
  
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 1 for calling the Distribution obj's underlying member method code with example usage: obj.__call__() and returns: self