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: Returns a representation of the parametrized distribution's support,
  along the first dimension. This is implemented only by discrete
  distributions.
  
  Note that this returns support values of all the batched RVs in
  lock-step, rather than the full cartesian product.
  
  :param bool expand: whether to expand the result to a tensor of shape
      ``(n,) + batch_shape + event_shape``. If false, the return value
      has unexpanded shape ``(n,) + (1,)*len(batch_shape) + event_shape``
      which can be broadcasted to the full shape.
  :return: An iterator over the distribution's discrete support.
  :rtype: iterator
docstr_tok: ["Returns","a","representation","of","the","parametrized","distribution","'s","support",",","along","the","first","dimension",".","This","is","implemented","only","by","discrete","distributions",".","Note","that","this","returns","support","values","of","all","the","batched","RVs","in","lock-step",",","rather","than","the","full","cartesian","product",".",":","param","bool","expand",":","whether","to","expand","the","result","to","a","tensor","of","shape","``","(","n",",",")","+","batch_shape","+","event_shape","``",".","If","false",",","the","return","value","has","unexpanded","shape","``","(","n",",",")","+","(","1",",",")","*","len","(","batch_shape",")","+","event_shape","``","which","can","be","broadcasted","to","the","full","shape",".",":","return",":","An","iterator","over","the","distribution","'s","discrete","support",".",":","rtype",":","iterator"]
code: def enumerate_support(self, expand: bool = True) -> torch.Tensor:
      """
      Returns a representation of the parametrized distribution's support,
      along the first dimension. This is implemented only by discrete
      distributions.
  
      Note that this returns support values of all the batched RVs in
      lock-step, rather than the full cartesian product.
  
      :param bool expand: whether to expand the result to a tensor of shape
          ``(n,) + batch_shape + event_shape``. If false, the return value
          has unexpanded shape ``(n,) + (1,)*len(batch_shape) + event_shape``
          which can be broadcasted to the full shape.
      :return: An iterator over the distribution's discrete support.
      :rtype: iterator
      """
      raise NotImplementedError(
          "Support not implemented for {}".format(type(self).__name__)
      )
  
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 5 for calling the Distribution obj's underlying member method code with example usage: obj.enumerate_support(expand) without return types